mirror of
https://github.com/django/django.git
synced 2024-12-22 17:16:24 +00:00
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:
parent
d39b5cae68
commit
93b1f9ad6e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user