mirror of https://github.com/django/django.git
[3.1.x] Refs #30997 -- Improved HttpRequest.is_ajax() warning message with stacklevel=2.
Backport of 7fc317ae73
from master
This commit is contained in:
parent
fdd2b01e8e
commit
619e3db7d5
|
@ -262,6 +262,7 @@ class HttpRequest:
|
||||||
'request.is_ajax() is deprecated. See Django 3.1 release notes '
|
'request.is_ajax() is deprecated. See Django 3.1 release notes '
|
||||||
'for more details about this deprecation.',
|
'for more details about this deprecation.',
|
||||||
RemovedInDjango40Warning,
|
RemovedInDjango40Warning,
|
||||||
|
stacklevel=2,
|
||||||
)
|
)
|
||||||
return self.META.get('HTTP_X_REQUESTED_WITH') == 'XMLHttpRequest'
|
return self.META.get('HTTP_X_REQUESTED_WITH') == 'XMLHttpRequest'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue