Skip to content

Commit

Permalink
combine user exist check with user deleted check
Browse files Browse the repository at this point in the history
  • Loading branch information
laperlej committed Jun 29, 2024
1 parent beb7054 commit 2579e81
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/galaxy/managers/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,11 +613,9 @@ def send_reset_email(self, trans, payload, **kwd):

def get_reset_token(self, trans, email):
reset_user = get_user_by_email(trans.sa_session, email, self.app.model.User)
if reset_user and reset_user.deleted:
return None, None
if not reset_user and email != email.lower():
reset_user = self._get_user_by_email_case_insensitive(trans.sa_session, email)
if reset_user:
if reset_user and not reset_user.deleted:
prt = self.app.model.PasswordResetToken(reset_user)
trans.sa_session.add(prt)
with transaction(trans.sa_session):
Expand Down

0 comments on commit 2579e81

Please sign in to comment.