mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-23 11:51:05 -05:00
Add error messages for bad international addresses
Template preview started putting these in the metadata of the S3 object
in this pull request: https://github.com/alphagov/notifications-template-preview/pull/445
Specific error key is defined here:
800b48fce5/app/precompiled.py (L558)
This commit is contained in:
11
app/utils.py
11
app/utils.py
@@ -669,6 +669,17 @@ LETTER_VALIDATION_MESSAGES = {
|
||||
'Validation failed because the last line of the address is not a real UK postcode.'
|
||||
),
|
||||
},
|
||||
'not-a-real-uk-postcode-or-country': {
|
||||
'title': 'There’s a problem with the address for this letter',
|
||||
'detail': (
|
||||
'The last line of the address must be a UK postcode or '
|
||||
'another country.'
|
||||
),
|
||||
'summary': (
|
||||
'Validation failed because the last line of the address is '
|
||||
'not a UK postcode or another country.'
|
||||
),
|
||||
},
|
||||
'not-enough-address-lines': {
|
||||
'title': 'There’s a problem with the address for this letter',
|
||||
'detail': (
|
||||
|
||||
@@ -508,6 +508,19 @@ def test_get_letter_validation_error_for_unknown_error():
|
||||
'Validation failed because the last line of the address is not a real UK postcode.'
|
||||
),
|
||||
),
|
||||
(
|
||||
'not-a-real-uk-postcode-or-country',
|
||||
None,
|
||||
'There’s a problem with the address for this letter',
|
||||
(
|
||||
'The last line of the address must be a UK postcode or '
|
||||
'another country.'
|
||||
),
|
||||
(
|
||||
'Validation failed because the last line of the address is '
|
||||
'not a UK postcode or another country.'
|
||||
),
|
||||
),
|
||||
(
|
||||
'not-enough-address-lines',
|
||||
None,
|
||||
|
||||
Reference in New Issue
Block a user