diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-03-26 15:07:19 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-07-21 15:07:41 +0200 |
commit | 18556dec8d2989f715d2251342aa4368fda857c8 (patch) | |
tree | b355300b8710c45b1f86795793ea8224b91ce6c9 /ishtar_common/utils.py | |
parent | f4a1bd2de96dfc246bd89c8849f1f6188616cd9c (diff) | |
download | Ishtar-18556dec8d2989f715d2251342aa4368fda857c8.tar.bz2 Ishtar-18556dec8d2989f715d2251342aa4368fda857c8.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 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 |