Skip to content

Commit

Permalink
lints
Browse files Browse the repository at this point in the history
  • Loading branch information
chiatt committed Jan 30, 2019
1 parent f05ac1d commit 32f1d26
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
6 changes: 3 additions & 3 deletions arches/app/media/js/viewmodels/mobile-survey.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,14 @@ define([
cards.push(m.cardid);
});
});
return cards
return cards;
});

this.mobilesurvey.cards(this.resourceOrderedCards())
this.mobilesurvey.cards(this.resourceOrderedCards());

this.resourceOrderedCards.subscribe(function(val){
self.mobilesurvey.cards(val);
})
});

this.selectedResourceIds = ko.pureComputed({
read: function() {
Expand Down
5 changes: 3 additions & 2 deletions arches/app/views/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def get_child_cardids(card, cardset):
projects_for_couch = [project.serialize_for_mobile() for project in projects]
for project in projects_for_couch:
permitted_cards = set()
ordered_project_cards = project['cards'];
ordered_project_cards = project['cards']
for rootcardid in project['cards']:
card = models.CardModel.objects.get(cardid=rootcardid)
if str(card.nodegroup_id) in permitted_nodegroups:
Expand All @@ -163,7 +163,8 @@ def get_child_cardids(card, cardset):
cards = []
for card in graph['cards']:
if card['cardid'] in project['cards']:
card['relative_position'] = ordered_project_cards.index(card['cardid']) if card['cardid'] in ordered_project_cards else None
card['relative_position'] = ordered_project_cards.index(
card['cardid']) if card['cardid'] in ordered_project_cards else None
cards.append(card)
graph['cards'] = sorted(cards, key=lambda x: x['relative_position'])
response = JSONResponse(projects_for_couch, indent=4)
Expand Down
6 changes: 4 additions & 2 deletions arches/app/views/mobile_survey.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ def get_survey_resources(mobile_survey):
for i, graph in enumerate(graphs):
cards = []
if i == 0 or unicode(graph.graphid) in active_graphs:
cards = [Card.objects.get(pk=card.cardid) for card in models.CardModel.objects.filter(graph=graph).order_by('sortorder')]
resources.append({'name': graph.name, 'id': graph.graphid, 'subtitle': graph.subtitle, 'iconclass': graph.iconclass, 'cards': cards})
cards = [Card.objects.get(pk=card.cardid) for card in models.CardModel.objects.filter(
graph=graph).order_by('sortorder')]
resources.append({'name': graph.name, 'id': graph.graphid,
'subtitle': graph.subtitle, 'iconclass': graph.iconclass, 'cards': cards})

return resources

Expand Down

0 comments on commit 32f1d26

Please sign in to comment.