no more errors for invalid tokens
This commit is contained in:
parent
b6aa6f4e85
commit
a9d07856e4
|
@ -10,7 +10,7 @@ def check_helper(get_response):
|
||||||
# Code to be executed for each request before
|
# Code to be executed for each request before
|
||||||
# the view (and later middleware) are called.
|
# the view (and later middleware) are called.
|
||||||
if request.session.get("token"):
|
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:
|
if not tk:
|
||||||
del request.session["token"]
|
del request.session["token"]
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue