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:
Chris Hill-Scott
2020-10-05 17:17:21 +01:00
parent 229d5eb716
commit c8e85efd54
3 changed files with 51 additions and 0 deletions

View File

@@ -47,6 +47,7 @@ from app.main.validators import (
MustContainAlphanumericCharacters,
NoCommasInPlaceHolders,
NoEmbeddedImagesInSVG,
NoPlaceholders,
OnlySMSCharacters,
ValidEmail,
ValidGovEmail,
@@ -1217,6 +1218,7 @@ class SMSTemplateForm(BaseTemplateForm):
class BroadcastTemplateForm(SMSTemplateForm):
def validate_template_content(self, field):
OnlySMSCharacters(template_type='broadcast')(None, field)
NoPlaceholders()(None, field)
class LetterAddressForm(StripWhitespaceForm):