Skip to content

Commit

Permalink
prevent non-string row types from breaking save
Browse files Browse the repository at this point in the history
rows with row['type'] = {'x':'y'} is deprecated
  • Loading branch information
dorey committed Oct 21, 2016
1 parent b79ffa0 commit ded418c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions kpi/utils/asset_content_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,13 @@ def get_summary(self):
return {}

for row in self.survey:
# pyxform's csv_to_dict() returns an OrderedDict, so we have to be
# more tolerant than `type(row) == dict`
if isinstance(row, dict):
_type = row.get('type')
_label = row.get('label')
if _type in GEO_TYPES:
geo = True

if not _type or _type.startswith('end'):
if not _type or isinstance(_type, dict) or _type.startswith('end'):
summary_errors.append(row)
continue
if _type in META_TYPES:
Expand Down

0 comments on commit ded418c

Please sign in to comment.