mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-06 19:28:25 -04:00
Fix missing CSRF token on send SMS page
As part of https://github.com/alphagov/notifications-admin/pull/187 the file upload pattern was changed to auto-submit once a file had been picked. The form that was submitted was, however, missing a CSRF token, as well as a submit button for non-JS users. This commit makes the file upload pattern self-contained, so that it will always include a form with a CSRF token in a hidden input and a submit button, which is then hidden when Javascript loads.
This commit is contained in:
@@ -45,12 +45,7 @@
|
||||
<a href="{{url_for('.send_sms', service_id=service_id, template_id=template.id)}}" class="page-footer-back-link">Back</a>
|
||||
</form>
|
||||
{% else %}
|
||||
<form method="post" action="{{ url_for('.send_sms', service_id=service_id, template_id=template.id) }}" enctype="multipart/form-data">
|
||||
{{file_upload(form.file, button_text='Choose a CSV file')}}
|
||||
{{ page_footer(
|
||||
"Upload"
|
||||
) }}
|
||||
</form>
|
||||
{{file_upload(form.file, button_text='Upload a CSV file')}}
|
||||
{% endif %}
|
||||
|
||||
{% call(item) list_table(
|
||||
|
||||
Reference in New Issue
Block a user