mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
Check for invalid chars in letter addresses when sending through the API
This uses the new method in notifications-utils to validate for invalid characters in address blocks.
This commit is contained in:
@@ -409,6 +409,10 @@ def validate_address(service, letter_data):
|
||||
raise ValidationError(
|
||||
message='Must be a real UK postcode'
|
||||
)
|
||||
if address.has_invalid_characters:
|
||||
raise ValidationError(
|
||||
message='Address lines must not start with any of the following characters: @ ( ) = [ ] ” \\ / ,'
|
||||
)
|
||||
|
||||
|
||||
def process_precompiled_letter_notifications(*, letter_data, api_key, service, template, reply_to_text):
|
||||
|
||||
Reference in New Issue
Block a user