Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions deux/notifications.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
from __future__ import absolute_import, unicode_literals

from twilio.rest import TwilioRestClient
from twilio.rest.exceptions import TwilioRestException
try:
from twilio.rest import Client as TwilioRestClient
except ImportError:
from twilio.rest import TwilioRestClient
print("DeprecationWarning: Importing TwilioRestClient from twilio.rest"
" is deprecated. Update twilio package to >6.x")

try:
from twilio.base.exceptions import TwilioRestException
except ImportError:
from twilio.rest.exceptions import TwilioRestException
print("DeprecationWarning: Importing TwilioRestException from twilio.rest"
" is deprecated. Update twilio package to >6.x")

from deux import strings
from deux.app_settings import mfa_settings
Expand Down
2 changes: 1 addition & 1 deletion deux/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@

#: Regex validator for phone numbers.
phone_number_validator = RegexValidator(
regex=r"^(\d{7,15})$",
regex=r"^\+[1-9]\d{1,14}$",
message=strings.INVALID_PHONE_NUMBER_ERROR)