mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
Let whitelist and user have int. phone numbers
On the frontend, we’re letting users register with international phone numbers. So we shouldn’t block users from doing this on the API side. Same thing for the whitelist, where we’re also allowing international phone numbers now.
This commit is contained in:
@@ -318,7 +318,7 @@ class ServiceWhitelist(db.Model):
|
||||
|
||||
try:
|
||||
if recipient_type == MOBILE_TYPE:
|
||||
validate_phone_number(recipient)
|
||||
validate_phone_number(recipient, international=True)
|
||||
instance.recipient = recipient
|
||||
elif recipient_type == EMAIL_TYPE:
|
||||
validate_email_address(recipient)
|
||||
|
||||
@@ -130,7 +130,7 @@ class UserUpdateAttributeSchema(BaseSchema):
|
||||
@validates('mobile_number')
|
||||
def validate_mobile_number(self, value):
|
||||
try:
|
||||
validate_phone_number(value)
|
||||
validate_phone_number(value, international=True)
|
||||
except InvalidPhoneError as error:
|
||||
raise ValidationError('Invalid phone number: {}'.format(error))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user