diff options
| author | Rob Hudson | 2008-09-30 14:08:47 -0700 | 
|---|---|---|
| committer | Rob Hudson | 2008-09-30 14:08:47 -0700 | 
| commit | 51a79cfcb7d731f951647778d504a3e654d4883f (patch) | |
| tree | 8cf7dab1b73f42786e17b29a9416798aed2c3e70 /debug_toolbar/middleware.py | |
| parent | 005f67ebbc37dca871fc211e1fc46b9299e4787b (diff) | |
| download | django-debug-toolbar-51a79cfcb7d731f951647778d504a3e654d4883f.tar.bz2 | |
Adding toolbar config to override INTERCEPT_REDIRECTS and, in the future, other
configurable pieces of the toolbar.
Diffstat (limited to 'debug_toolbar/middleware.py')
| -rw-r--r-- | debug_toolbar/middleware.py | 15 | 
1 files changed, 8 insertions, 7 deletions
| diff --git a/debug_toolbar/middleware.py b/debug_toolbar/middleware.py index 58712d9..140ceba 100644 --- a/debug_toolbar/middleware.py +++ b/debug_toolbar/middleware.py @@ -59,13 +59,14 @@ class DebugToolbarMiddleware(object):      def process_response(self, request, response):          if not self.debug_toolbar:              return response -        if isinstance(response, HttpResponseRedirect): -            redirect_to = response.get('Location', None) -            if redirect_to: -                response = render_to_response( -                    'debug_toolbar/redirect.html', -                    {'redirect_to': redirect_to} -                ) +        if self.debug_toolbar.config['INTERCEPT_REDIRECTS']: +            if isinstance(response, HttpResponseRedirect): +                redirect_to = response.get('Location', None) +                if redirect_to: +                    response = render_to_response( +                        'debug_toolbar/redirect.html', +                        {'redirect_to': redirect_to} +                    )          if response.status_code != 200:              return response          for panel in self.debug_toolbar.panels: | 
