mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-08 20:33:11 -04:00
Set accepted files for job spreadsheet upload
This commit is contained in:
@@ -187,13 +187,15 @@ def send_messages(service_id, template_id):
|
||||
))
|
||||
|
||||
column_headings = get_spreadsheet_column_headings_from_template(template)
|
||||
allowed_spreadsheet_file_extensions = ','.join([f'.{ext}' for ext in Spreadsheet.ALLOWED_FILE_EXTENSIONS])
|
||||
|
||||
return render_template(
|
||||
'views/send.html',
|
||||
template=template,
|
||||
column_headings=list(ascii_uppercase[:len(column_headings)]),
|
||||
example=[column_headings, get_example_csv_rows(template)],
|
||||
form=form
|
||||
form=form,
|
||||
allowed_spreadsheet_file_extensions=allowed_spreadsheet_file_extensions
|
||||
)
|
||||
|
||||
|
||||
@@ -709,6 +711,7 @@ def _check_messages(service_id, template_id, upload_id, preview_row, letters_as_
|
||||
def check_messages(service_id, template_id, upload_id, row_index=2):
|
||||
|
||||
data = _check_messages(service_id, template_id, upload_id, row_index)
|
||||
data['allowed_spreadsheet_file_extensions'] = ','.join([f'.{ext}' for ext in Spreadsheet.ALLOWED_FILE_EXTENSIONS])
|
||||
|
||||
if (
|
||||
data['recipients'].too_many_rows
|
||||
|
||||
@@ -137,6 +137,7 @@
|
||||
{% if not request.args.from_test %}
|
||||
{{ file_upload(
|
||||
form.file,
|
||||
allowed_file_extensions=allowed_spreadsheet_file_extensions,
|
||||
action=url_for('.send_messages', service_id=current_service.id, template_id=template.id),
|
||||
button_text='Upload your file again'
|
||||
) }}
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
<div class="form-group">
|
||||
{{ file_upload(
|
||||
form.file,
|
||||
allowed_file_extensions=allowed_spreadsheet_file_extensions,
|
||||
action=url_for('.send_messages', service_id=current_service.id, template_id=template.id),
|
||||
button_text='Upload your file again'
|
||||
) }}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
<div class="page-footer bottom-gutter">
|
||||
{{file_upload(
|
||||
form.file,
|
||||
allowed_file_extensions=allowed_spreadsheet_file_extensions,
|
||||
button_text='Choose a file'
|
||||
)}}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user