diff --git a/lib/galaxy/security/validate_user_input.py b/lib/galaxy/security/validate_user_input.py index 5375a4afbb7..7150c0831e8 100644 --- a/lib/galaxy/security/validate_user_input.py +++ b/lib/galaxy/security/validate_user_input.py @@ -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." diff --git a/lib/galaxy/webapps/galaxy/controllers/user.py b/lib/galaxy/webapps/galaxy/controllers/user.py index 96ba8b0a786..ff138960711 100644 --- a/lib/galaxy/webapps/galaxy/controllers/user.py +++ b/lib/galaxy/webapps/galaxy/controllers/user.py @@ -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: