diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2009-07-02 14:02:58 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2009-07-02 14:02:58 +0000 |
| commit | 88da053e5ed4c0641c942471acbf67b09e488ddd (patch) | |
| tree | c1278c500ac3f0355c8cd67735f42e8a2d395fd8 | |
| parent | 923c6755c88f19ad7fc0cd74cf818037f85dfb43 (diff) | |
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.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11155 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/core/urlresolvers.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/django/core/urlresolvers.py b/django/core/urlresolvers.py index b3dcfdb8c1..10e97bbcd5 100644 --- a/django/core/urlresolvers.py +++ b/django/core/urlresolvers.py @@ -185,7 +185,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()]) @@ -195,7 +199,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: |
