Skip to content

Commit

Permalink
use sa20 syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavcs committed Aug 8, 2023
1 parent 8ab8c44 commit 3642731
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/galaxy/managers/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
and_,
exc,
func,
select,
true,
)
from sqlalchemy.orm.exc import NoResultFound
Expand Down Expand Up @@ -843,7 +844,8 @@ def get_user_by_username(app, username):
"""Get a user from the database by username."""
sa_session = app.model.session
try:
user = sa_session.query(app.model.User).filter(app.model.User.table.c.username == username).one()
stmt = select(model.User).filter(model.User.username == username)
user = session.execute(stmt).scalar_one()
return user
except Exception:
return None

0 comments on commit 3642731

Please sign in to comment.