Skip to content

Commit

Permalink
Merge pull request #17772 from mvdbeek/fix_it_again
Browse files Browse the repository at this point in the history
[24.0] Fix anon user values again
  • Loading branch information
mvdbeek authored Mar 18, 2024
2 parents be2201f + 8bb655e commit 1e7565b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/galaxy/webapps/galaxy/services/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,11 @@ def get_user(self, trans: ProvidesUserContext, user_id):
def _anon_user_api_value(self, trans: ProvidesHistoryContext):
"""Return data for an anonymous user, truncated to only usage and quota_percent"""
if not trans.user and not trans.history:
usage = None
usage: Optional[float] = 0.0
percent: Optional[int] = 0
else:
usage = self.quota_agent.get_usage(trans, history=trans.history)
percent = self.quota_agent.get_percent(trans=trans, usage=usage)
percent = self.quota_agent.get_percent(trans=trans, usage=usage)
usage = usage or 0
return {
"total_disk_usage": int(usage),
Expand Down

0 comments on commit 1e7565b

Please sign in to comment.