Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.0.X] Fixed #10834 -- Corrected [11120] to ensure that there is a d…

…ifference between catching a bad URL pattern and an new (no URLs) project. Thanks to Matt Welch for the report.

Merge of r11155 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@11156 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit c60901c031f3053cbe4e81cb8eb3e653bd3ac9aa 1 parent 2a7b781
Russell Keith-Magee authored July 02, 2009

Showing 1 changed file with 6 additions and 2 deletions. Show diff stats Hide diff stats

  1. 8  django/core/urlresolvers.py
8  django/core/urlresolvers.py
@@ -182,7 +182,11 @@ def resolve(self, path):
182 182
                 try:
183 183
                     sub_match = pattern.resolve(new_path)
184 184
                 except Resolver404, e:
185  
-                    tried.extend([(pattern.regex.pattern + '   ' + t) for t in e.args[0]['tried']])
  185
+                    sub_tried = e.args[0].get('tried')
  186
+                    if sub_tried is not None:
  187
+                        tried.extend([(pattern.regex.pattern + '   ' + t) for t in sub_tried])
  188
+                    else:
  189
+                        tried.append(pattern.regex.pattern)
186 190
                 else:
187 191
                     if sub_match:
188 192
                         sub_match_dict = dict([(smart_str(k), v) for k, v in match.groupdict().items()])
@@ -192,7 +196,7 @@ def resolve(self, path):
192 196
                         return sub_match[0], sub_match[1], sub_match_dict
193 197
                     tried.append(pattern.regex.pattern)
194 198
             raise Resolver404, {'tried': tried, 'path': new_path}
195  
-        raise Resolver404, {'tried': [], 'path' : path}
  199
+        raise Resolver404, {'path' : path}
196 200
 
197 201
     def _get_urlconf_module(self):
198 202
         try:

0 notes on commit c60901c

Please sign in to comment.
Something went wrong with that request. Please try again.