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:
Chris Hill-Scott
2016-03-24 16:57:25 +00:00
parent ed1d988bf4
commit e3ae81bd0a
3 changed files with 6 additions and 8 deletions

View File

@@ -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