Skip to content

Commit

Permalink
Merge pull request #1 from axiacore/django3.1
Browse files Browse the repository at this point in the history
🍭 Suppress is_ajax django deprecation warning
  • Loading branch information
camilonova authored Sep 2, 2020
2 parents f32f116 + 8ab7d16 commit 456ad1b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .prospector.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
strictness: high
test-warnings: true
doc-warnings: false
autodetect: true
member-warnings: false

ignore-paths:
- __init__.py

uses:
- django

pep8:
full: true
options:
max-line-length: 100
2 changes: 1 addition & 1 deletion ax3_mixins/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class AjaxRequestMixin:
def dispatch(self, request, *args, **kwargs):
if not request.is_ajax():
if request.META.get('HTTP_X_REQUESTED_WITH') != 'XMLHttpRequest':
return HttpResponseBadRequest()

return super().dispatch(request, *args, **kwargs)
Expand Down

0 comments on commit 456ad1b

Please sign in to comment.