mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-20 14:29:25 -04:00
Add sms sender to service to be used in sms templates
in place of default numeric short code. If not present default short code is used.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import re
|
||||
from datetime import (
|
||||
datetime,
|
||||
date
|
||||
@@ -106,6 +107,11 @@ class ServiceSchema(BaseSchema):
|
||||
exclude = ("updated_at", "created_at", "api_keys", "templates", "jobs", 'old_id')
|
||||
strict = True
|
||||
|
||||
@validates('sms_sender')
|
||||
def validate_sms_sender(self, value):
|
||||
if value and not re.match('^[a-zA-Z0-9\s]+$', value):
|
||||
raise ValidationError('Only alphanumeric characters allowed')
|
||||
|
||||
|
||||
class NotificationModelSchema(BaseSchema):
|
||||
class Meta:
|
||||
|
||||
Reference in New Issue
Block a user