From f83a1ca1190d2357f668ea182c7b20181fe117e7 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 b4437b367..7f0808602 100644 --- a/ishtar_common/utils.py +++ b/ishtar_common/utils.py @@ -911,6 +911,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