From b8b9c95dcadbba3227606a7a7be41eab1370e8a4 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Mon, 25 Jun 2007 16:19:36 +0000 Subject: [PATCH] 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 --- django/core/urlresolvers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/core/urlresolvers.py b/django/core/urlresolvers.py index a7c686aec5..f4c2dc4677 100644 --- a/django/core/urlresolvers.py +++ b/django/core/urlresolvers.py @@ -201,7 +201,7 @@ class RegexURLResolver(object): 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():