aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/middleware.py
diff options
context:
space:
mode:
authorAymeric Augustin2013-11-15 20:45:32 +0100
committerAymeric Augustin2013-11-15 20:45:32 +0100
commite89992a951b05b20dcd5c59927041d41b23110c9 (patch)
treefd51cafbcc151bb44c7d363810031bae70067468 /debug_toolbar/middleware.py
parent57e3169fe3ca4b6bd23faee12911b3177eba8aa4 (diff)
downloaddjango-debug-toolbar-e89992a951b05b20dcd5c59927041d41b23110c9.tar.bz2
Implement redirects interception as a panel.
Fix #122.
Diffstat (limited to 'debug_toolbar/middleware.py')
-rw-r--r--debug_toolbar/middleware.py14
1 files changed, 0 insertions, 14 deletions
diff --git a/debug_toolbar/middleware.py b/debug_toolbar/middleware.py
index edcf17f..c1d052c 100644
--- a/debug_toolbar/middleware.py
+++ b/debug_toolbar/middleware.py
@@ -7,8 +7,6 @@ from __future__ import unicode_literals
import threading
from django.conf import settings
-from django.http import HttpResponseRedirect
-from django.shortcuts import render
from django.utils.encoding import force_text
from debug_toolbar.toolbar import DebugToolbar
@@ -92,18 +90,6 @@ class DebugToolbarMiddleware(object):
toolbar = self.__class__.debug_toolbars.pop(threading.current_thread().ident, None)
if not toolbar or getattr(response, 'streaming', False):
return response
- if isinstance(response, HttpResponseRedirect):
- if not toolbar.config['INTERCEPT_REDIRECTS']:
- return response
- redirect_to = response.get('Location', None)
- if redirect_to:
- cookies = response.cookies
- response = render(
- request,
- 'debug_toolbar/redirect.html',
- {'redirect_to': redirect_to}
- )
- response.cookies = cookies
for panel in reversed(toolbar.enabled_panels):
new_response = panel.process_response(request, response)
if new_response: