mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-16 02:02:13 -05:00
Strip trailing CSV rows, relax phone validation
Implements (and depends on): - https://github.com/alphagov/notifications-utils/pull/14 - https://github.com/alphagov/notifications-utils/pull/15
This commit is contained in:
@@ -7,7 +7,7 @@ from marshmallow_sqlalchemy import field_for
|
||||
from utils.recipients import (
|
||||
validate_email_address, InvalidEmailError,
|
||||
validate_phone_number, InvalidPhoneError,
|
||||
format_phone_number
|
||||
validate_and_format_phone_number
|
||||
)
|
||||
|
||||
|
||||
@@ -132,9 +132,7 @@ class SmsNotificationSchema(NotificationSchema):
|
||||
|
||||
@post_load
|
||||
def format_phone_number(self, item):
|
||||
item['to'] = format_phone_number(validate_phone_number(
|
||||
item['to'])
|
||||
)
|
||||
item['to'] = validate_and_format_phone_number(item['to'])
|
||||
return item
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user