Code

Ticket #13684: 13684_local_variable_resolver.1.diff

File 13684_local_variable_resolver.1.diff, 945 bytes (added by akaihola, 4 years ago)

moves default url resolver setup outside try..except

Line 
1diff --git a/django/core/handlers/base.py b/django/core/handlers/base.py
2index 79f6607..9af87d0 100644
3--- a/django/core/handlers/base.py
4+++ b/django/core/handlers/base.py
5@@ -69,12 +69,12 @@ class BaseHandler(object):
6         from django.conf import settings
7 
8         try:
9-            try:
10-                # Setup default url resolver for this thread.
11-                urlconf = settings.ROOT_URLCONF
12-                urlresolvers.set_urlconf(urlconf)
13-                resolver = urlresolvers.RegexURLResolver(r'^/', urlconf)
14+            # Setup default url resolver for this thread.
15+            urlconf = settings.ROOT_URLCONF
16+            urlresolvers.set_urlconf(urlconf)
17+            resolver = urlresolvers.RegexURLResolver(r'^/', urlconf)
18 
19+            try:
20                 # Apply request middleware
21                 for middleware_method in self._request_middleware:
22                     response = middleware_method(request)