diff --git a/jupyterhub/apihandlers/auth.py b/jupyterhub/apihandlers/auth.py index e0c9fb4f..aa395edd 100644 --- a/jupyterhub/apihandlers/auth.py +++ b/jupyterhub/apihandlers/auth.py @@ -70,7 +70,7 @@ class TokenAPIHandler(APIHandler): note = (data or {}).get('note') if not note: - note = "via api" + note = "Requested via deprecated api" if requester is not user: kind = 'user' if isinstance(user, User) else 'service' note += " by %s %s" % (kind, requester.name) diff --git a/jupyterhub/apihandlers/users.py b/jupyterhub/apihandlers/users.py index 79234c36..6d15f954 100644 --- a/jupyterhub/apihandlers/users.py +++ b/jupyterhub/apihandlers/users.py @@ -224,7 +224,7 @@ class UserTokenListAPIHandler(APIHandler): kind = 'user' if isinstance(requester, User) else 'service' note = (body or {}).get('note') if not note: - note = "via api" + note = "Requested via api" if requester is not user: note += " by %s %s" % (kind, requester.name) diff --git a/jupyterhub/tests/test_api.py b/jupyterhub/tests/test_api.py index ab874f16..dcab20af 100644 --- a/jupyterhub/tests/test_api.py +++ b/jupyterhub/tests/test_api.py @@ -1219,7 +1219,7 @@ def test_get_new_token(app, headers, status, note): if note: assert reply['note'] == note else: - assert reply['note'] == 'via api' + assert reply['note'] == 'Requested via api' token_id = reply['id'] initial = normalize_token(reply) # pop token for later comparison