diff --git a/lib/galaxy/webapps/galaxy/api/users.py b/lib/galaxy/webapps/galaxy/api/users.py index 8eb658c81bf..ed652790b01 100644 --- a/lib/galaxy/webapps/galaxy/api/users.py +++ b/lib/galaxy/webapps/galaxy/api/users.py @@ -297,7 +297,7 @@ class UserAPIController(BaseGalaxyAPIController, UsesTagsMixin, BaseUIController else: user = trans.user else: - return managers_base.get_object( + user = managers_base.get_object( trans, user_id, "User", @@ -306,9 +306,7 @@ class UserAPIController(BaseGalaxyAPIController, UsesTagsMixin, BaseUIController # check that the user is requesting themselves (and they aren't del'd) unless admin if not trans.user_is_admin: if trans.user != user or user.deleted: - raise exceptions.InsufficientPermissionsException( - "You are not allowed to perform action on that user", id=user_id - ) + raise exceptions.RequestParameterInvalidException("Invalid user id specified", id=user_id) return user except exceptions.MessageException: raise