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