From 6207ea9d54bccc0cab0913b1b638aec29858e70a Mon Sep 17 00:00:00 2001 From: kmichel Date: Thu, 31 May 2012 16:31:42 +0300 Subject: [PATCH 1/2] Propagate handler403 value when wrapping urlconf --- debug_toolbar/middleware.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debug_toolbar/middleware.py b/debug_toolbar/middleware.py index d24bcaf5c..6979c8d84 100644 --- a/debug_toolbar/middleware.py +++ b/debug_toolbar/middleware.py @@ -84,6 +84,8 @@ def process_request(self, request): new_urlconf.urlpatterns = debug_toolbar.urls.urlpatterns + \ list(urlconf.urlpatterns) + if hasattr(urlconf, 'handler403'): + new_urlconf.handler404 = urlconf.handler403 if hasattr(urlconf, 'handler404'): new_urlconf.handler404 = urlconf.handler404 if hasattr(urlconf, 'handler500'): From 8331e70299f1ec79077c17503ab5359cbbd7faa0 Mon Sep 17 00:00:00 2001 From: kmichel Date: Sun, 3 Jun 2012 15:20:45 +0300 Subject: [PATCH 2/2] Fixed typo when propagating handler403 value It was propagated to handler404 instead of handler403. --- debug_toolbar/middleware.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debug_toolbar/middleware.py b/debug_toolbar/middleware.py index 6979c8d84..af898f1a4 100644 --- a/debug_toolbar/middleware.py +++ b/debug_toolbar/middleware.py @@ -85,7 +85,7 @@ def process_request(self, request): list(urlconf.urlpatterns) if hasattr(urlconf, 'handler403'): - new_urlconf.handler404 = urlconf.handler403 + new_urlconf.handler403 = urlconf.handler403 if hasattr(urlconf, 'handler404'): new_urlconf.handler404 = urlconf.handler404 if hasattr(urlconf, 'handler500'):