Catch duplicate recipient columns in spreadsheets

If someone has duplicate recipient columns in their file we don’t know
which one to use. This commit adds an error message which should help
them fix the duplication.

This commit doesn’t go to the extra effort to actually show the
correct values for duplication in the preview. Don’t think it’s worth
the effort/complexity for how infrequently we’ve seen this error.

Depends on:
- [ ] https://github.com/alphagov/notifications-utils/pull/376
This commit is contained in:
Chris Hill-Scott
2018-03-02 10:45:29 +00:00
parent ea94d466b6
commit a4424e999f
4 changed files with 66 additions and 3 deletions

View File

@@ -581,6 +581,7 @@ def check_messages(service_id, template_type, upload_id, row_index=2):
data['recipients'].too_many_rows or
not data['count_of_recipients'] or
not data['recipients'].has_recipient_columns or
data['recipients'].duplicate_recipient_column_headers or
data['recipients'].missing_column_headers
):
return render_template('views/check/column-errors.html', **data)