provide a better error message when creating a user account with non-ASCII characters
This commit is contained in:
parent
dcd971d079
commit
01f2451349
|
@ -261,8 +261,10 @@ def add_mail_user(email, pw, privs, env):
|
|||
# validate email
|
||||
if email.strip() == "":
|
||||
return ("No email address provided.", 400)
|
||||
if not validate_email(email, mode='user'):
|
||||
elif not validate_email(email):
|
||||
return ("Invalid email address.", 400)
|
||||
elif not validate_email(email, mode='user'):
|
||||
return ("User account email addresses may only use the ASCII letters A-Z, the digits 0-9, underscore (_), hyphen (-), and period (.).", 400)
|
||||
|
||||
validate_password(pw)
|
||||
|
||||
|
|
Loading…
Reference in New Issue