This commit is contained in:
bakatrouble 2022-04-10 11:51:46 +03:00
parent 7d82bbc16c
commit 24c39f71a6

View File

@ -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