Merge pull request #2294 from alphagov/no-canonical-magic

Validate non canonical domains
This commit is contained in:
Chris Hill-Scott
2018-09-06 15:34:11 +01:00
committed by GitHub
3 changed files with 50 additions and 16 deletions

View File

@@ -33,6 +33,7 @@ from wtforms.validators import URL, DataRequired, Length, Optional, Regexp
from app.main.validators import (
Blacklist,
CanonicalGovernmentDomain,
CsvFileValidator,
DoesNotStartWithDoubleZero,
KnownGovernmentDomain,
@@ -721,7 +722,10 @@ class ServicePreviewBranding(StripWhitespaceForm):
class GovernmentDomainField(StringField):
validators = [KnownGovernmentDomain()]
validators = [
KnownGovernmentDomain(),
CanonicalGovernmentDomain(),
]
def post_validate(self, form, validation_stopped):
if self.data and not self.errors: