mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Prevent exception in toolshed if userid is 'current'
and the user is not already logged in (=trans.user is None). Fixes https://sentry.galaxyproject.org/sentry/toolshed/issues/568664/
This commit is contained in:
@@ -106,11 +106,7 @@ class UsersController(BaseAPIController):
|
||||
"""
|
||||
user = None
|
||||
# user is requesting data about themselves
|
||||
if id == "current" and trans.user:
|
||||
user = trans.user
|
||||
else:
|
||||
user = suc.get_user(trans.app, id)
|
||||
|
||||
user = trans.user if id == 'current' else suc.get_user(trans.app, id)
|
||||
if user is None:
|
||||
user_dict = dict(message='Unable to locate user record for id %s.' % (str(id)),
|
||||
status='error')
|
||||
|
||||
Reference in New Issue
Block a user