From 1740cd748366c5bde81df9ce15cb6fdabd94260a Mon Sep 17 00:00:00 2001 From: Agate Berriot Date: Wed, 31 Aug 2022 09:12:39 +0200 Subject: [PATCH] django4: replaced deprecated request.is_ajax() call (#68571) --- mellon/middleware.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mellon/middleware.py b/mellon/middleware.py index 78ec782..9bc5ac8 100644 --- a/mellon/middleware.py +++ b/mellon/middleware.py @@ -44,7 +44,7 @@ class PassiveAuthenticationMiddleware(MiddlewareMixin): if 'no-passive-auth' in request.GET: return # Skip AJAX requests - if request.is_ajax(): + if request.headers.get('x-requested-with') == 'XMLHttpRequest': return # Skip AJAX and media/script requests, unless mellon_no_passive is False on the view if getattr(view_func, 'mellon_no_passive', True) and 'text/html' not in request.META.get(