mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-25 18:38:57 -04:00
Don’t allow personalisation in broadcast templates
Since we don’t have a way of filling in the personalisation at the moment we shouldn’t allow people to make templates that require it.
This commit is contained in:
@@ -108,6 +108,18 @@ class OnlySMSCharacters:
|
||||
)
|
||||
|
||||
|
||||
class NoPlaceholders:
|
||||
|
||||
def __init__(self, message=None):
|
||||
self.message = message or (
|
||||
'You can’t use ((double brackets)) to personalise this message'
|
||||
)
|
||||
|
||||
def __call__(self, form, field):
|
||||
if Field(field.data).placeholders:
|
||||
raise ValidationError(self.message)
|
||||
|
||||
|
||||
class LettersNumbersFullStopsAndUnderscoresOnly:
|
||||
|
||||
regex = re.compile(r'^[a-zA-Z0-9\s\._]+$')
|
||||
|
||||
Reference in New Issue
Block a user