Merge pull request #2460 from alphagov/hex-error-message

Make hex colour code error more helpful
This commit is contained in:
Chris Hill-Scott
2018-11-07 11:18:08 +00:00
committed by GitHub

View File

@@ -752,7 +752,7 @@ class ServiceUpdateEmailBranding(StripWhitespaceForm):
colour = StringField(
'Colour',
validators=[
Regexp(regex="^$|^#(?:[0-9a-fA-F]{3}){1,2}$", message='Must be a valid color hex code')
Regexp(regex="^$|^#(?:[0-9a-fA-F]{3}){1,2}$", message='Must be a valid color hex code (starting with #)')
]
)
file = FileField_wtf('Upload a PNG logo', validators=[FileAllowed(['png'], 'PNG Images only!')])