don't remove if-none-match header on editor ajax

This commit is contained in:
Laura Klünder 2017-10-27 17:21:04 +02:00
parent 7ae53e262d
commit 6e9d2424f8

View file

@ -17,11 +17,13 @@ def sidebar_view(func=None, select_related=None):
def with_ajax_check(request, *args, **kwargs):
request.changeset = ChangeSet.get_for_request(request, select_related)
if request.is_ajax() or 'ajax' in request.GET:
ajax = request.is_ajax() or 'ajax' in request.GET
if not ajax:
request.META.pop('HTTP_IF_NONE_MATCH', None)
response = func(request, *args, **kwargs)
if request.is_ajax() or 'ajax' in request.GET:
if ajax:
if isinstance(response, HttpResponseRedirect):
return render(request, 'editor/redirect.html', {'target': response['location']})
if not isinstance(response, HttpResponseNotModified):