diff options
| author | Rob Hudson | 2008-09-07 12:02:07 -0700 | 
|---|---|---|
| committer | Rob Hudson | 2008-09-07 12:02:07 -0700 | 
| commit | 73423718e09fb71b89012d9c1d9f0890e759f7a5 (patch) | |
| tree | f4bea2af8f982cf0dfde5bf365f2d79a4a2306d3 /debug_toolbar/middleware.py | |
| parent | 571a5196ef049cc1a948370753528a864653a7c0 (diff) | |
| download | django-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.py | 2 | 
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 | 
