mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 05:59:44 -04:00
Replace UK phone numbers in tests with US numbers
This commit is contained in:
@@ -14,7 +14,6 @@ from notifications_utils.formatters import strip_all_whitespace
|
||||
from notifications_utils.insensitive_dict import InsensitiveDict
|
||||
from notifications_utils.recipients import (
|
||||
InvalidPhoneError,
|
||||
normalise_phone_number,
|
||||
validate_phone_number,
|
||||
)
|
||||
from werkzeug.utils import cached_property
|
||||
@@ -1538,10 +1537,9 @@ class ServiceContactDetailsForm(StripWhitespaceForm):
|
||||
self.email_address.validators = [DataRequired(), Length(min=5, max=255), ValidEmail()]
|
||||
|
||||
elif self.contact_details_type.data == 'phone_number':
|
||||
# we can't use the existing phone number validation functions here since we want to allow landlines
|
||||
def valid_phone_number(self, num):
|
||||
try:
|
||||
normalise_phone_number(num.data)
|
||||
validate_phone_number(num.data, international=True)
|
||||
return True
|
||||
except InvalidPhoneError:
|
||||
raise ValidationError('Must be a valid phone number')
|
||||
|
||||
Reference in New Issue
Block a user