diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-03-26 15:07:19 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-10-15 19:32:59 +0200 |
commit | ae5bd7720b27ebf3790c50d1b1e6c95edbc089cf (patch) | |
tree | 531a86368283408f4fe40864619d4d42371f96bd /ishtar_common/utils.py | |
parent | e89868b074912e4dfcb79dd16af1f78e4782033e (diff) | |
download | Ishtar-ae5bd7720b27ebf3790c50d1b1e6c95edbc089cf.tar.bz2 Ishtar-ae5bd7720b27ebf3790c50d1b1e6c95edbc089cf.zip |
♻️ django 3.2 deprecation: replace is_ajax by custom method
Diffstat (limited to 'ishtar_common/utils.py')
-rw-r--r-- | ishtar_common/utils.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ishtar_common/utils.py b/ishtar_common/utils.py index bd20e4919..c503c42b9 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 |