Changed reverse URL resolving to handle the case where an included file does
not have a urlpatterns attribute. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5538 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
85f6f15263
commit
b8b9c95dca
|
@ -201,7 +201,7 @@ class RegexURLResolver(object):
|
||||||
self._reverse_dict = {}
|
self._reverse_dict = {}
|
||||||
|
|
||||||
def _get_reverse_dict(self):
|
def _get_reverse_dict(self):
|
||||||
if not self._reverse_dict:
|
if not self._reverse_dict and hasattr(self.urlconf_module, 'urlpatterns'):
|
||||||
for pattern in reversed(self.urlconf_module.urlpatterns):
|
for pattern in reversed(self.urlconf_module.urlpatterns):
|
||||||
if isinstance(pattern, RegexURLResolver):
|
if isinstance(pattern, RegexURLResolver):
|
||||||
for key, value in pattern.reverse_dict.iteritems():
|
for key, value in pattern.reverse_dict.iteritems():
|
||||||
|
|
Loading…
Reference in New Issue