Added Multiple SMS sender functionality

This commit is contained in:
chrisw
2017-10-24 15:37:44 +01:00
parent 8ec50971eb
commit 4e721c95ce
13 changed files with 638 additions and 229 deletions

View File

@@ -505,6 +505,7 @@ class ServiceSmsSender(Form):
Length(max=11, message="Enter 11 characters or fewer")
]
)
is_default = BooleanField("Make this text message sender the default")
def validate_sms_sender(self, field):
if field.data and not re.match(r'^[a-zA-Z0-9\s]+$', field.data):
@@ -674,6 +675,19 @@ class PasswordFieldShowHasContent(StringField):
widget = widgets.PasswordInput(hide_value=False)
class ServiceInboundNumberForm(Form):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.inbound_number.choices = kwargs['inbound_number_choices']
inbound_number = RadioField(
"Select your inbound number",
validators=[
DataRequired("Option must be selected")
]
)
class ServiceInboundApiForm(Form):
url = StringField("Inbound sms url",
validators=[DataRequired(message='Cant be empty'),