From 386e23dfacc758ecffce07473390f9bcb552912c Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 19 Oct 2020 14:35:22 +0200 Subject: [PATCH] core: fix api signature for view_key --- passbook/core/api/tokens.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/passbook/core/api/tokens.py b/passbook/core/api/tokens.py index bffbaf42e..166d76012 100644 --- a/passbook/core/api/tokens.py +++ b/passbook/core/api/tokens.py @@ -1,6 +1,4 @@ """Tokens API Viewset""" -from uuid import UUID - from django.http.response import Http404 from rest_framework.decorators import action from rest_framework.request import Request @@ -29,10 +27,9 @@ class TokenViewSet(ModelViewSet): serializer_class = TokenSerializer @action(detail=True) - # pylint: disable=invalid-name - def view_key(self, request: Request, pk: UUID) -> Response: + def view_key(self, request: Request, identifier: str) -> Response: """Return token key and log access""" - tokens = Token.filter_not_expired(pk=pk) + tokens = Token.filter_not_expired(identifier=identifier) if not tokens.exists(): raise Http404 token = tokens.first()