Validate International phone numbers

- uses new utils methods to validate phone numbers
- defaults to International=True on validation. This ensures the validator works on all numbers
- Then check if the user can send this message to the number internationally if needed.
This commit is contained in:
Martyn Inglis
2017-04-26 15:56:45 +01:00
parent 3d312c7342
commit 2a0f8c8808
12 changed files with 224 additions and 28 deletions

View File

@@ -123,7 +123,8 @@ def sample_service(
user=None,
restricted=False,
limit=1000,
email_from=None
email_from=None,
can_send_international_sms=False
):
if user is None:
user = create_user()
@@ -136,6 +137,7 @@ def sample_service(
'email_from': email_from,
'created_by': user,
'letter_contact_block': 'London,\nSW1A 1AA',
'can_send_international_sms': can_send_international_sms
}
service = Service.query.filter_by(name=service_name).first()
if not service: