Allow international addresses in spreadsheets

For services with permission, they can now put international addresses
into their spreadsheets without getting a postcode error.

This also means they can start using address line 7 instead of postcode,
since it doesn’t make sense to put a country in a field called
‘postcode’. But this will be undocumented to start with, because we’re
not giving any real users the permission.

It does now mean that the number of possible placeholders (7 + postcode)
is greater than the number of allowed placeholders (7), so we have to
account for that in the one-off address flow where we’re populating the
placeholders automatically. We’re sticking with 6 + postcode here for
backwards compatibility.
This commit is contained in:
Chris Hill-Scott
2020-04-27 10:57:25 +01:00
parent 832445774b
commit 06108de0f7
9 changed files with 197 additions and 30 deletions

View File

@@ -84,8 +84,12 @@
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.postcode %}
Last line of the address must be a real UK postcode
{% 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 %}