From 18556dec8d2989f715d2251342aa4368fda857c8 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 26 Mar 2025 15:07:19 +0100 Subject: ♻️ django 3.2 deprecation: replace is_ajax by custom method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ishtar_common/utils.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ishtar_common/utils.py') diff --git a/ishtar_common/utils.py b/ishtar_common/utils.py index 8089715d3..ca78993c2 100644 --- a/ishtar_common/utils.py +++ b/ishtar_common/utils.py @@ -917,6 +917,14 @@ def is_downloadable(curl): return True +def is_xmlhttprequest(request): + """ + Replace "is_ajax". + Be careful: do not work with Fetch API. + """ + return request.headers.get('x-requested-with') == 'XMLHttpRequest' + + def get_file_from_link(file_link): """ return filename and temp_file object from a web link -- cgit v1.2.3