Don’t allow adding unknown domains to branding lookup

We should make sure we’re not putting typos in the branding list. We can
validate what gets entered here against our known list of public-sector
domains.
This commit is contained in:
Chris Hill-Scott
2018-09-03 11:06:30 +01:00
parent 47c9b71fa8
commit 80423dfb3f
3 changed files with 53 additions and 7 deletions

View File

@@ -35,6 +35,7 @@ from app.main.validators import (
Blacklist,
CsvFileValidator,
DoesNotStartWithDoubleZero,
KnownGovernmentDomain,
LettersNumbersAndFullStopsOnly,
NoCommasInPlaceHolders,
OnlyGSMCharacters,
@@ -722,7 +723,7 @@ class ServicePreviewBranding(StripWhitespaceForm):
class ServiceUpdateEmailBranding(StripWhitespaceForm):
name = StringField('Name of brand')
text = StringField('Text')
domain = StringField('Domain')
domain = StringField('Domain', validators=[KnownGovernmentDomain()])
colour = StringField(
'Colour',
validators=[