aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/middleware.py
diff options
context:
space:
mode:
authorRickey Visinski2012-08-24 13:10:13 -0400
committerRickey Visinski2012-08-24 13:10:13 -0400
commit4d0b77e446c62e40387228aea39056424232b827 (patch)
tree0182605f31a8bf2a82c79bbfcb52b9adfc559f15 /debug_toolbar/middleware.py
parentee837a347ab48494df92ed0470f6729fe8f56db9 (diff)
downloaddjango-debug-toolbar-4d0b77e446c62e40387228aea39056424232b827.tar.bz2
saving characters, and let django sort out the ajaxness
Diffstat (limited to 'debug_toolbar/middleware.py')
-rw-r--r--debug_toolbar/middleware.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/debug_toolbar/middleware.py b/debug_toolbar/middleware.py
index e063b3b..1979e1d 100644
--- a/debug_toolbar/middleware.py
+++ b/debug_toolbar/middleware.py
@@ -116,9 +116,7 @@ class DebugToolbarMiddleware(object):
__traceback_hide__ = True
ident = thread.get_ident()
toolbar = self.__class__.debug_toolbars.get(ident)
- if not toolbar:
- return response
- if 'XMLHttpRequest' in request.META.get('HTTP_X_REQUESTED_WITH', ''):
+ if not toolbar or request.is_ajax():
return response
if isinstance(response, HttpResponseRedirect):
if not toolbar.config['INTERCEPT_REDIRECTS']: