1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-25 16:17:24 +02:00

Render only useful content when displaying modals

This commit is contained in:
Emmy D'Anello
2023-02-20 17:53:45 +01:00
parent a8f24b6581
commit 69b94c9493
25 changed files with 37 additions and 22 deletions

View File

@ -52,3 +52,16 @@ class SessionMiddleware(object):
_set_current_user_and_ip(None, None, None)
return response
class FetchMiddleware(object):
"""
This middleware let requests to know when this was called by a fetch command or not.
"""
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request):
request.content_only = 'CONTENT_ONLY' in request.headers
return self.get_response(request)