diff options
Diffstat (limited to 'ishtar_common/views.py')
-rw-r--r-- | ishtar_common/views.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ishtar_common/views.py b/ishtar_common/views.py index 50c16419c..e37136bcd 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -93,6 +93,7 @@ from ishtar_common.utils import ( put_session_message, get_model_by_slug, human_date, + is_xmlhttprequest ) from ishtar_common.widgets import JQueryAutoComplete from ishtar_common import tasks @@ -771,7 +772,7 @@ def unpin(request, item_type, cascade=False): def update_current_item(request, item_type=None, pk=None): if not item_type or not pk: - if not request.is_ajax() and not request.method == "POST": + if not is_xmlhttprequest(request) and not request.method == "POST": raise Http404 item_type = request.POST["item"] if "value" in request.POST and "item" in request.POST: @@ -842,7 +843,8 @@ def pin_search(request, item_type): item_type = "administrativeact" key = "pin-search-" + item_type if not item_type or not ( - request.is_ajax() and request.method == "POST" and "value" in request.POST + is_xmlhttprequest(request) and request.method == "POST" + and "value" in request.POST ): raise Http404 request.session[key] = request.POST["value"] |