Skip to content

Commit

Permalink
Merge pull request #17645 from mvdbeek/no_500_anon_api_users
Browse files Browse the repository at this point in the history
[24.0] Don't fail for anon /api/users request
  • Loading branch information
martenson authored Mar 8, 2024
2 parents b2698cc + 299d80d commit aef5fdf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/galaxy/webapps/galaxy/services/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,11 @@ def get_index(
and not trans.app.config.expose_user_name
and not trans.app.config.expose_user_email
):
item = trans.user.to_dict()
return [item]
if trans.user:
item = trans.user.to_dict()
return [item]
else:
return []
stmt = stmt.filter(User.deleted == false())
for user in trans.sa_session.scalars(stmt).all():
item = user.to_dict()
Expand Down

0 comments on commit aef5fdf

Please sign in to comment.