mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-15 17:52:26 -05:00
Validate International phone numbers
- uses new utils methods to validate phone numbers - defaults to International=True on validation. This ensures the validator works on all numbers - Then check if the user can send this message to the number internationally if needed.
This commit is contained in:
@@ -11,7 +11,7 @@ def validate(json_to_validate, schema):
|
||||
@format_checker.checks('phone_number', raises=InvalidPhoneError)
|
||||
def validate_schema_phone_number(instance):
|
||||
if instance is not None:
|
||||
validate_phone_number(instance)
|
||||
validate_phone_number(instance, international=True)
|
||||
return True
|
||||
|
||||
@format_checker.checks('email_address', raises=InvalidEmailError)
|
||||
|
||||
Reference in New Issue
Block a user