1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-30 01:11:12 +02:00

Add extra access to juries

This commit is contained in:
Yohann D'ANELLO
2020-05-25 18:27:07 +02:00
parent 522ed088ef
commit 3d9e7136ac
8 changed files with 264 additions and 155 deletions

View File

@ -64,6 +64,22 @@ class SessionMiddleware(object):
return response
class ExtraAccessMiddleware(object):
"""
This middleware allows some non authenticated people to access to pool data.
"""
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request):
if "extra_access_token" in request.GET:
request.session["extra_access_token"] = request.GET["extra_access_token"]
else:
request.session.setdefault("extra_access_token", "")
return self.get_response(request)
class TurbolinksMiddleware(object):
"""
Send the `Turbolinks-Location` header in response to a visit that was redirected,