mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge pull request #5320 from bernt-matthias/topic/allow_empty_mail
allow registration with empty email
This commit is contained in:
@@ -24,12 +24,12 @@ FILL_CHAR = '-'
|
||||
PASSWORD_MIN_LEN = 6
|
||||
|
||||
|
||||
def validate_email(trans, email, user=None, check_dup=True):
|
||||
def validate_email(trans, email, user=None, check_dup=True, allow_empty=False):
|
||||
"""
|
||||
Validates the email format, also checks whether the domain is blacklisted in the disposable domains configuration.
|
||||
"""
|
||||
message = ''
|
||||
if user and user.email == email:
|
||||
if (user and user.email == email) or (email == "" and allow_empty):
|
||||
return message
|
||||
if not(VALID_EMAIL_RE.match(email)):
|
||||
message = "The format of the email address is not correct."
|
||||
|
||||
@@ -532,7 +532,7 @@ class User(BaseUIController, UsesFormDefinitionsMixin, CreatesUsersMixin, Create
|
||||
if autoreg["auto_reg"]:
|
||||
kwd['email'] = autoreg["email"]
|
||||
kwd['username'] = autoreg["username"]
|
||||
message = " ".join([validate_email(trans, kwd['email']),
|
||||
message = " ".join([validate_email(trans, kwd['email'], allow_empty=True),
|
||||
validate_publicname(trans, kwd['username'])]).rstrip()
|
||||
if not message:
|
||||
message, status, user, success = self.__register(trans, cntrller, False, no_redirect=skip_login_handling, **kwd)
|
||||
@@ -572,7 +572,6 @@ class User(BaseUIController, UsesFormDefinitionsMixin, CreatesUsersMixin, Create
|
||||
log.debug("trans.app.config.auth_config_file: %s" % trans.app.config.auth_config_file)
|
||||
if not user:
|
||||
message, status, user, success = self.__autoregistration(trans, login, password, status, kwd)
|
||||
|
||||
elif user.deleted:
|
||||
message = "This account has been marked deleted, contact your local Galaxy administrator to restore the account."
|
||||
if trans.app.config.error_email_to is not None:
|
||||
|
||||
Reference in New Issue
Block a user