Refs #30997 -- Improved HttpRequest.is_ajax() warning message with stacklevel=2.

This commit is contained in:
Mariusz Felisiak 2020-06-03 08:47:19 +02:00 committed by GitHub
parent df32fd42b8
commit 7fc317ae73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -262,6 +262,7 @@ class HttpRequest:
'request.is_ajax() is deprecated. See Django 3.1 release notes '
'for more details about this deprecation.',
RemovedInDjango40Warning,
stacklevel=2,
)
return self.META.get('HTTP_X_REQUESTED_WITH') == 'XMLHttpRequest'