aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/middleware.py
diff options
context:
space:
mode:
authorAymeric Augustin2013-10-15 10:01:47 +0200
committerAymeric Augustin2013-10-15 10:02:34 +0200
commit142caaa979645ff78b1928a018bb0a83e02a4218 (patch)
treec79515f78bacc4117ad90f256e177cfb86e9dc38 /debug_toolbar/middleware.py
parent0bd0abda661af29750bbd3263ab5f93a24b47511 (diff)
downloaddjango-debug-toolbar-142caaa979645ff78b1928a018bb0a83e02a4218.tar.bz2
Disable insertion in streaming responses.
Diffstat (limited to 'debug_toolbar/middleware.py')
-rw-r--r--debug_toolbar/middleware.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/debug_toolbar/middleware.py b/debug_toolbar/middleware.py
index 1ad1942..090e206 100644
--- a/debug_toolbar/middleware.py
+++ b/debug_toolbar/middleware.py
@@ -117,10 +117,10 @@ class DebugToolbarMiddleware(object):
__traceback_hide__ = True
ident = threading.currentThread().ident
toolbar = self.__class__.debug_toolbars.get(ident)
- if not toolbar or request.is_ajax():
+ if not toolbar or request.is_ajax() or getattr(response, 'streaming', False):
return response
if isinstance(response, HttpResponseRedirect):
- if not toolbar.config['INTERCEPT_REDIRECTS'] or request.is_ajax():
+ if not toolbar.config['INTERCEPT_REDIRECTS']:
return response
redirect_to = response.get('Location', None)
if redirect_to: