Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[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 freakboy3742 authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 django/core/urlresolvers.py
8 django/core/urlresolvers.py
View
@@ -182,7 +182,11 @@ def resolve(self, path):
try:
sub_match = pattern.resolve(new_path)
except Resolver404, e:
- tried.extend([(pattern.regex.pattern + ' ' + t) for t in e.args[0]['tried']])
+ sub_tried = e.args[0].get('tried')
+ if sub_tried is not None:
+ tried.extend([(pattern.regex.pattern + ' ' + t) for t in sub_tried])
+ else:
+ tried.append(pattern.regex.pattern)
else:
if sub_match:
sub_match_dict = dict([(smart_str(k), v) for k, v in match.groupdict().items()])
@@ -192,7 +196,7 @@ def resolve(self, path):
return sub_match[0], sub_match[1], sub_match_dict
tried.append(pattern.regex.pattern)
raise Resolver404, {'tried': tried, 'path': new_path}
- raise Resolver404, {'tried': [], 'path' : path}
+ raise Resolver404, {'path' : path}
def _get_urlconf_module(self):
try:
Please sign in to comment.
Something went wrong with that request. Please try again.