mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-03 23:51:22 -04:00
Check for invalid chars in letter addresses
This now adds validation for invalid characters on the LetterAddressForm for one off letters. It also adds a validation failed message for uploaded letters, precompiled letters sent through the API, and CSV rows with errors.
This commit is contained in:
12
app/utils.py
12
app/utils.py
@@ -733,7 +733,17 @@ LETTER_VALIDATION_MESSAGES = {
|
||||
f'Validation failed because the address must be no more '
|
||||
f'than {PostalAddress.MAX_LINES} lines long.'
|
||||
),
|
||||
}
|
||||
},
|
||||
'invalid-char-in-address': {
|
||||
'title': 'There’s a problem with the address for this letter',
|
||||
'detail': (
|
||||
"Address lines must not start with any of the following characters: @ ( ) = [ ] ” \\ / ,"
|
||||
),
|
||||
'summary': (
|
||||
"Validation failed because address lines must not start with any of the "
|
||||
"following characters: @ ( ) = [ ] ” \\ / ,"
|
||||
),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user