diff --git a/shiftregister/app/middleware.py b/shiftregister/app/middleware.py index 35f0821..9ca0701 100644 --- a/shiftregister/app/middleware.py +++ b/shiftregister/app/middleware.py @@ -10,7 +10,7 @@ def check_helper(get_response): # Code to be executed for each request before # the view (and later middleware) are called. if request.session.get("token"): - tk = LoginToken.objects.get(pk=request.session.get("token")) + tk = LoginToken.objects.filter(pk=request.session.get("token")).first() if not tk: del request.session["token"] else: