mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-02 17:48:50 -04:00
Error if a CSV file contains more than 50,000 rows
We want to limit the number of rows someone can have in a job, because it gets too slow to process the file otherwise. This should be the first error that a user sees, because we can’t work out if there are other errors until they’ve got the file down to a processable size. This also means adding a message to say that the file can’t be displayed if it doesn’t contain any processed rows. *** https://www.pivotaltracker.com/story/show/129830161
This commit is contained in:
@@ -15,7 +15,22 @@
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
{% if not recipients.has_recipient_column %}
|
||||
{% if recipients.has_too_many_rows %}
|
||||
|
||||
<div class="bottom-gutter">
|
||||
{% call banner_wrapper(type='dangerous') %}
|
||||
<h1 class='banner-title'>
|
||||
Your file has too many rows
|
||||
</h1>
|
||||
<p>
|
||||
Notify can process up to
|
||||
{{ "{:,}".format(recipients.max_rows) }} rows at once. Your
|
||||
file has {{ "{:,}".format(recipients|length) }} rows.
|
||||
</p>
|
||||
{% endcall %}
|
||||
</div>
|
||||
|
||||
{% elif not recipients.has_recipient_column %}
|
||||
|
||||
<div class="bottom-gutter">
|
||||
{% call banner_wrapper(type='dangerous') %}
|
||||
@@ -159,7 +174,8 @@
|
||||
{% call(item, row_number) list_table(
|
||||
recipients.initial_annotated_rows_with_errors if row_errors and not recipients.missing_column_headers else recipients.initial_annotated_rows,
|
||||
caption=original_file_name,
|
||||
field_headings=['1'] + recipients.column_headers
|
||||
field_headings=['1'] + recipients.column_headers,
|
||||
empty_message='Can’t show the contents of this file'
|
||||
) %}
|
||||
{{ index_field(item.index + 2) }}
|
||||
{% for column in recipients.column_headers %}
|
||||
|
||||
Reference in New Issue
Block a user