aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/middleware.py
diff options
context:
space:
mode:
authorRob Hudson2008-09-07 12:02:07 -0700
committerRob Hudson2008-09-07 12:02:07 -0700
commit73423718e09fb71b89012d9c1d9f0890e759f7a5 (patch)
treef4bea2af8f982cf0dfde5bf365f2d79a4a2306d3 /debug_toolbar/middleware.py
parent571a5196ef049cc1a948370753528a864653a7c0 (diff)
downloaddjango-debug-toolbar-73423718e09fb71b89012d9c1d9f0890e759f7a5.tar.bz2
adding a check to not display toolbar on ajax requests
Diffstat (limited to 'debug_toolbar/middleware.py')
-rw-r--r--debug_toolbar/middleware.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/debug_toolbar/middleware.py b/debug_toolbar/middleware.py
index 13a7e98..57222c5 100644
--- a/debug_toolbar/middleware.py
+++ b/debug_toolbar/middleware.py
@@ -26,7 +26,7 @@ class DebugToolbarMiddleware(object):
def process_response(self, request, response):
if settings.DEBUG:
- if response['Content-Type'].split(';')[0] in _HTML_TYPES:
+ if response['Content-Type'].split(';')[0] in _HTML_TYPES and not request.is_ajax():
#response.content = _END_HEAD_RE.sub(mark_safe(self.debug_toolbar.render_styles() + "%s" % match.group()), response.content)
response.content = _END_BODY_RE.sub(mark_safe(self.debug_toolbar.render_toolbar() + '</body>'), response.content)
return response