summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2009-07-02 14:44:28 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2009-07-02 14:44:28 +0000
commitc60901c031f3053cbe4e81cb8eb3e653bd3ac9aa (patch)
treef2c6e84584da5d479431251f344b12ae2aa63bc9
parent2a7b781cfee2f81ce808a56b13df4cedaad14d8c (diff)
[1.0.X] Fixed #10834 -- Corrected [11120] to ensure that there is a difference 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
-rw-r--r--django/core/urlresolvers.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/django/core/urlresolvers.py b/django/core/urlresolvers.py
index a63b822d28..fce8843aab 100644
--- a/django/core/urlresolvers.py
+++ b/django/core/urlresolvers.py
@@ -182,7 +182,11 @@ class RegexURLResolver(object):
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 @@ class RegexURLResolver(object):
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: