indigo
indigo copied to clipboard
Incorrectly formatted commencement date should show as an error in preview, not throw an error
The errors dict at this point does include something for commencement_date, but we should guard against it not existing (or ensure that it's None) elsewhere so that the error displays rather than a Server 500 error being thrown.
Sentry Issue: INDIGO-LAWSAFRICA-TK
AttributeError: 'SpreadsheetRow' object has no attribute 'commencement_date'
(9 additional frame(s) were not displayed)
...
File "indigo_app/views/works.py", line 933, in form_valid
works = self.bulk_creator.create_works(table, dry_run, workflow)
File "indigo/bulk_creator.py", line 251, in create_works
self.works.append(self.create_work(row, idx))
File "indigo_aa/plugins.py", line 51, in create_work
row = super().create_work(row, idx)
File "indigo/bulk_creator.py", line 292, in create_work
row = self.validate_row(row)
File "indigo/bulk_creator.py", line 409, in validate_row
elif row.commenced and not row.commencement_date and not row.commenced_on_date: