bakatrouble 2 years ago
parent 7d82bbc16c
commit 24c39f71a6

@ -66,7 +66,7 @@ class AjaxResponseMixin(object):
def dispatch(self, request, *args, **kwargs):
request_method = request.method.lower()
if request.is_ajax() and request_method in self.http_method_names:
if request.accepts("application/json") and request_method in self.http_method_names:
handler = getattr(self, "{0}_ajax".format(request_method),
self.http_method_not_allowed)
self.request = request

Loading…
Cancel
Save