Skip to content

Commit

Permalink
Merge pull request #1054 from onaio/csv-ordered-repeats
Browse files Browse the repository at this point in the history
XLSForm order in repeats for Flat CSV exports
  • Loading branch information
ukanga committed Jun 15, 2017
2 parents 15bfdd9 + e934ffa commit 0fe3488
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions onadata/libs/utils/csv_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
GROUP_DELIMITER_DOT = '.'
DEFAULT_GROUP_DELIMITER = GROUP_DELIMITER_SLASH
GROUP_DELIMITERS = [GROUP_DELIMITER_SLASH, GROUP_DELIMITER_DOT]
DEFAULT_NA_REP = getattr(settings, 'NA_REP', NA_REP)


def remove_dups_from_list_maintain_order(l):
Expand Down Expand Up @@ -348,8 +349,7 @@ def get_ordered_repeat_value(xpath, repeat_value):

for elem in children:
xp = elem.get_abbreviated_xpath()
if xp in repeat_value:
item[xp] = repeat_value[xp]
item[xp] = repeat_value.get(xp, DEFAULT_NA_REP)

return item

Expand Down

0 comments on commit 0fe3488

Please sign in to comment.