Content changes to error messages

This commit is contained in:
Pea Tyczynska
2019-11-27 15:56:55 +00:00
parent 64b35ba337
commit 9e0c8167ee
4 changed files with 21 additions and 19 deletions

View File

@@ -25,10 +25,10 @@
{% call banner_wrapper(type='dangerous') %}
{% if row_errors|length == 1 %}
<h1 class='banner-title' data-module="track-error" data-error-type="Bad rows" data-error-label="{{ upload_id }}">
There is a problem with {{ original_file_name }}
Theres a problem with {{ original_file_name }}
</h1>
<p>
You need to {{ row_errors[0] }}
You need to {{ row_errors[0] }}.
</p>
{% else %}
<h1 class='banner-title' data-module="track-error" data-error-type="Bad rows" data-error-label="{{ upload_id }}">

View File

@@ -134,16 +134,18 @@ def get_errors_for_csv(recipients, template_type):
if any(recipients.rows_with_message_too_long):
number_of_rows_with_message_too_long = len(list(recipients.rows_with_message_too_long))
if 1 == number_of_rows_with_message_too_long:
errors.append("shorten your message in 1 row")
errors.append("shorten the message in 1 row")
else:
errors.append("shorten your messages in {} rows".format(number_of_rows_with_message_too_long))
errors.append("shorten the messages in {} rows".format(number_of_rows_with_message_too_long))
if any(recipients.rows_with_empty_message):
number_of_rows_with_empty_message = len(list(recipients.rows_with_empty_message))
if 1 == number_of_rows_with_empty_message:
errors.append("add content to empty message in 1 row")
errors.append("check you have content for the empty message in 1 row")
else:
errors.append("add content to empty messages in {} rows".format(number_of_rows_with_empty_message))
errors.append("check you have content for the empty messages in {} rows".format(
number_of_rows_with_empty_message
))
return errors