diff --git a/lib/galaxy/webapps/galaxy/services/users.py b/lib/galaxy/webapps/galaxy/services/users.py index 91bcf390c0a7..fa820748c11c 100644 --- a/lib/galaxy/webapps/galaxy/services/users.py +++ b/lib/galaxy/webapps/galaxy/services/users.py @@ -122,10 +122,9 @@ 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: - # Can't return info about this user, may not have a history yet. - # return {} - raise glx_exceptions.MessageException(err_msg="The user has no history, which should always be the case.") - usage = self.quota_agent.get_usage(trans, history=trans.history) + usage = None + else: + usage = self.quota_agent.get_usage(trans, history=trans.history) percent = self.quota_agent.get_percent(trans=trans, usage=usage) usage = usage or 0 return { diff --git a/test/integration/oidc/test_auth_oidc.py b/test/integration/oidc/test_auth_oidc.py index 1674e9353079..29ff1c18b2b6 100644 --- a/test/integration/oidc/test_auth_oidc.py +++ b/test/integration/oidc/test_auth_oidc.py @@ -296,7 +296,8 @@ def test_oidc_logout(self): response = session.get(response.json()["redirect_uri"], verify=False) # make sure we can no longer request the user response = session.get(self._api_url("users/current")) - self._assert_status_code_is(response, 400) + self._assert_status_code_is(response, 200) + assert "email" not in response.json() def test_auth_by_access_token_logged_in_once(self): # login at least once