Give specific error if international letters off

If a service doesn’t have permission to send international letters but
someone tries to upload a letter with a valid international address we
just tell them that the last line must be a UK postcode.

This is a bit opaque and:
- suggests that we’re not recognising at all that it’s not a UK letter
- doesn’t explain why it must be a UK postcode

This commit adds a new, error message which tells users why their letter
can’t be sent. And hopefully will give them a better idea of how to
resolve the problem, if they really do need to be able to send
international letters.
This commit is contained in:
Chris Hill-Scott
2020-09-10 11:18:20 +01:00
parent 5e579ed45c
commit f824b3a5eb
5 changed files with 32 additions and 1 deletions

View File

@@ -79,6 +79,8 @@
{% 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
{% elif item.as_postal_address.international %}
You do not have permission to send letters to other countries
{% else %}
Last line of the address must be a real UK postcode
{% endif %}