mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 14:29:51 -04:00
Merge pull request #4089 from alphagov/flash-upload-errors-177535141
Show flash instead of inline upload errors
This commit is contained in:
@@ -175,6 +175,11 @@ def send_messages(service_id, template_id):
|
||||
).format(
|
||||
form.file.data.filename
|
||||
))
|
||||
elif form.errors:
|
||||
# just show the first error, as we don't expect the form to have more
|
||||
# than one, since it only has one field
|
||||
first_field_errors = list(form.errors.values())[0]
|
||||
flash(first_field_errors[0])
|
||||
|
||||
column_headings = get_spreadsheet_column_headings_from_template(template)
|
||||
|
||||
|
||||
@@ -417,6 +417,11 @@ def upload_contact_list(service_id):
|
||||
).format(
|
||||
form.file.data.filename
|
||||
))
|
||||
elif form.errors:
|
||||
# just show the first error, as we don't expect the form to have more
|
||||
# than one, since it only has one field
|
||||
first_field_errors = list(form.errors.values())[0]
|
||||
flash(first_field_errors[0])
|
||||
|
||||
return render_template(
|
||||
'views/uploads/contact-list/upload.html',
|
||||
|
||||
Reference in New Issue
Block a user