Merge pull request #3416 from alphagov/validate-3-lines-csv

Allow all the new address goodness in spreadsheets
This commit is contained in:
Chris Hill-Scott
2020-05-01 15:37:08 +01:00
committed by GitHub
11 changed files with 281 additions and 43 deletions

View File

@@ -58,15 +58,16 @@
<h1 class='banner-title' data-module="track-error" data-error-type="Missing recipient columns" data-error-label="{{ upload_id }}">
Theres a problem with your column names
</h1>
{% if template.template_type == 'letter' %}
<p>
Your file needs {{ (
recipients.missing_column_headers
if template.template_type == 'letter' else required_recipient_columns
) | formatted_list(
prefix='a column called',
prefix_plural='columns called'
) }}.
Your file needs at least 3 address columns, for example address line 1,
address line 2 and address line 3.
</p>
{% else %}
<p>
Your file needs a column called {{ first_recipient_column }}.
</p>
{% endif %}
<p>
Right now it has {{ recipients.column_headers | formatted_list(
prefix='one column, called ',

View File

@@ -80,6 +80,16 @@
No content for this message
{% elif item.message_too_long %}
Message is too long
{% elif not item.as_postal_address.has_enough_lines %}
Address must be at least {{ letter_min_address_lines }} lines long
{% elif item.as_postal_address.has_too_many_lines %}
Address must be no more than {{ letter_max_address_lines }} lines long
{% elif not item.as_postal_address.has_valid_last_line %}
{% if item.as_postal_address.allow_international_letters %}
Last line of the address must be a UK postcode or another country
{% else %}
Last line of the address must be a real UK postcode
{% endif %}
{% endif %}
</span>
{% endcall %}