mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Try case-insensitive match on email also when it's lowercase
Fix login for a user whose registered email is mixed case which tries to login with lowercase.
This commit is contained in:
@@ -138,7 +138,8 @@ class User(BaseUIController, UsesFormDefinitionsMixin, CreatesApiKeysMixin):
|
||||
trans.app.model.User.table.c.email == login,
|
||||
trans.app.model.User.table.c.username == login
|
||||
)).first()
|
||||
if not user and login.lower() != login:
|
||||
if not user:
|
||||
# Try a case-insensitive match on the email
|
||||
user = trans.sa_session.query(trans.app.model.User).filter(
|
||||
func.lower(trans.app.model.User.table.c.email) == login.lower()
|
||||
).first()
|
||||
|
||||
Reference in New Issue
Block a user