Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Changed reverse URL resolving to handle the case where an included fi…

…le does

not have a urlpatterns attribute.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5538 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit b8b9c95dcadbba3227606a7a7be41eab1370e8a4 1 parent 85f6f15
@malcolmt malcolmt authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  django/core/urlresolvers.py
View
2  django/core/urlresolvers.py
@@ -201,7 +201,7 @@ def __init__(self, regex, urlconf_name, default_kwargs=None):
self._reverse_dict = {}
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):
if isinstance(pattern, RegexURLResolver):
for key, value in pattern.reverse_dict.iteritems():
Please sign in to comment.
Something went wrong with that request. Please try again.