Merge branch 'master' into error-handing

This commit is contained in:
Rebecca Law
2016-03-11 13:59:16 +00:00
2 changed files with 9 additions and 7 deletions

View File

@@ -24,7 +24,7 @@ from sqlalchemy.exc import SQLAlchemyError
from app.aws import s3
from datetime import datetime
from utils.template import Template
from utils.recipients import RecipientCSV
from utils.recipients import RecipientCSV, validate_phone_number, format_phone_number
@notify_celery.task(name="delete-verify-codes")
@@ -219,7 +219,9 @@ def send_sms(service_id, notification_id, encrypted_notification, created_at):
def allowed_send_to_number(service, to):
if service.restricted and to not in [user.mobile_number for user in service.users]:
if service.restricted and format_phone_number(validate_phone_number(to)) not in [
format_phone_number(validate_phone_number(user.mobile_number)) for user in service.users
]:
return False
return True