Skip to content

Commit

Permalink
Merge pull request #287 from the-deep/fix-export-empty-values
Browse files Browse the repository at this point in the history
Fill geo cells in excel export if geo is missing
  • Loading branch information
Bibek Pandey authored May 2, 2019
2 parents e85c841 + 841d849 commit 4376b81
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions apps/export/entries/excel_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,17 +209,19 @@ def add_entries_from_excel_data(self, rows, data, export_data):
else:
row_values.extend(['', ''])
rows_value.append(row_values[::-1])
rows.add_rows_of_value_lists(rows_value)
if len(rows_value) > 0:
rows.add_rows_of_value_lists(rows_value)
else:
rows.add_rows_of_value_lists([['' for i in range(0, max_levels)] * 2])
else:
if export_data:
if export_data.get('type') == 'list':
rows.add_rows_of_values(
row_values = [
# This is in hope of filtering out non-existent data from excel row
[
x for x in export_data.get('value', [])
if x is not None
]
)
x for x in export_data.get('value', [])
if x is not None
]
rows.add_rows_of_values(row_values if row_values else [''])
else:
rows.add_value(export_data.get('value'))
else:
Expand Down

0 comments on commit 4376b81

Please sign in to comment.