Skip to content

Commit

Permalink
Skip bad XLS forms in migration #13
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Ross committed Oct 18, 2016
1 parent f808461 commit 8885f62
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,11 @@ def reprocess_multilingual_forms(apps, schema_editor):
Questionnaire = apps.get_model('questionnaires', 'Questionnaire')
for quest in Questionnaire.objects.all():
# Parse XLS form and check multilingual settings.
json = parse_file_to_json(quest.xls_form.file.name)
try:
json = parse_file_to_json(quest.xls_form.file.name)
except:
# Skip bad forms.
continue
has_default_language = (
'default_language' in json and
json['default_language'] != 'default'
Expand Down

0 comments on commit 8885f62

Please sign in to comment.