Change email whitelist error message to not include the list of allowed domains (#2286)

* Change email whitelist error message to not include the list of allowed domains
This commit is contained in:
Kevin Chung
2023-04-13 14:23:18 -04:00
committed by GitHub
parent 440aaddfb1
commit 2a6f47d2ea
2 changed files with 2 additions and 8 deletions

View File

@@ -265,11 +265,7 @@ def register():
if not valid_email:
errors.append("Please enter a valid email address")
if email.check_email_is_whitelisted(email_address) is False:
errors.append(
"Only email addresses under {domains} may register".format(
domains=get_config("domain_whitelist")
)
)
errors.append("Your email address is not from an allowed domain")
if names:
errors.append("That user name is already taken")
if team_name_email_check is True:

View File

@@ -150,9 +150,7 @@ class UserSchema(ma.ModelSchema):
)
if check_email_is_whitelisted(email) is False:
raise ValidationError(
"Only email addresses under {domains} may register".format(
domains=get_config("domain_whitelist")
),
"Email address is not from an allowed domain",
field_names=["email"],
)
if get_config("verify_emails"):