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:
@ -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,
|
||||
|
Reference in New Issue
Block a user