mirror of
https://github.com/django/django.git
synced 2025-07-18 16:49:13 +00:00
[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
This commit is contained in:
parent
2a7b781cfe
commit
c60901c031
@ -182,7 +182,11 @@ class RegexURLResolver(object):
|
|||||||
try:
|
try:
|
||||||
sub_match = pattern.resolve(new_path)
|
sub_match = pattern.resolve(new_path)
|
||||||
except Resolver404, e:
|
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:
|
else:
|
||||||
if sub_match:
|
if sub_match:
|
||||||
sub_match_dict = dict([(smart_str(k), v) for k, v in match.groupdict().items()])
|
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
|
return sub_match[0], sub_match[1], sub_match_dict
|
||||||
tried.append(pattern.regex.pattern)
|
tried.append(pattern.regex.pattern)
|
||||||
raise Resolver404, {'tried': tried, 'path': new_path}
|
raise Resolver404, {'tried': tried, 'path': new_path}
|
||||||
raise Resolver404, {'tried': [], 'path' : path}
|
raise Resolver404, {'path' : path}
|
||||||
|
|
||||||
def _get_urlconf_module(self):
|
def _get_urlconf_module(self):
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user