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 d46cd3323..73511c03e 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -92,6 +92,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 @@ -770,7 +771,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: @@ -841,7 +842,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"] |