2
0
Fork 0

no more errors for invalid tokens

This commit is contained in:
Andreas (@xAndy) Zimmermann 2022-04-21 00:36:00 +02:00
parent b6aa6f4e85
commit a9d07856e4
1 changed files with 1 additions and 1 deletions

View File

@ -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: