Fix issue with uppercase in the domain name.

This commit is contained in:
Nicholas Staples
2016-04-06 16:45:35 +01:00
parent 2ae33f0179
commit 2352b0f80d
2 changed files with 5 additions and 2 deletions

View File

@@ -36,5 +36,5 @@ class ValidEmailDomainRegex(object):
"https://docs.google.com/forms/d/1AL8U-xJX_HAFEiQiJszGQw0PcEaEUnYATSntEghNDGo/viewform")
valid_domains = current_app.config.get('EMAIL_DOMAIN_REGEXES', [])
email_regex = "[^\@^\s]+@([^@^\\.^\\s]+\.)*({})$".format("|".join(valid_domains))
if not re.match(email_regex, field.data):
if not re.match(email_regex, field.data.lower()):
raise ValidationError(message)