Changed error code of UserTokenListAPIHandler back to 403

This commit is contained in:
0mar
2021-04-21 09:43:24 +02:00
parent 399203e5d3
commit 103c6a406a
2 changed files with 3 additions and 3 deletions

View File

@@ -336,7 +336,7 @@ class UserTokenListAPIHandler(APIHandler):
scope_filter = self.get_scope_filter('users:tokens')
if user is None or not scope_filter(user, kind):
raise web.HTTPError(
404,
403,
f"{kind.title()} {user_name} not found or no permissions to generate tokens",
)

View File

@@ -1310,8 +1310,8 @@ async def test_get_new_token(app, headers, status, note, expires_in):
"as_user, for_user, status",
[
('admin', 'other', 200),
('admin', 'missing', 404),
('user', 'other', 404),
('admin', 'missing', 403),
('user', 'other', 403),
('user', 'user', 200),
],
)