Made extract_views_from_urlpatterns() in admin.views.doc tolerant of URLconfs that point to views that don't exist (raise ImportError)

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3691 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2006-08-31 21:35:36 +00:00
parent d39b5cae68
commit 93b1f9ad6e
1 changed files with 5 additions and 1 deletions

View File

@ -334,7 +334,11 @@ def extract_views_from_urlpatterns(urlpatterns, base=''):
except ViewDoesNotExist:
continue
elif hasattr(p, '_get_url_patterns'):
views.extend(extract_views_from_urlpatterns(p.url_patterns, base + p.regex.pattern))
try:
patterns = p.url_patterns
except ImportError:
continue
views.extend(extract_views_from_urlpatterns(patterns, base + p.regex.pattern))
else:
raise TypeError, _("%s does not appear to be a urlpattern object") % p
return views