Fixed #16573 -- Corrected a regression in the admindocs app's view overview introduced in r16405. Thanks, lopopolo.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16609 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
02dcbe3317
commit
a539d434d9
|
@ -349,17 +349,17 @@ def extract_views_from_urlpatterns(urlpatterns, base=''):
|
||||||
"""
|
"""
|
||||||
views = []
|
views = []
|
||||||
for p in urlpatterns:
|
for p in urlpatterns:
|
||||||
if hasattr(p, 'callback'):
|
if hasattr(p, 'url_patterns'):
|
||||||
try:
|
|
||||||
views.append((p.callback, base + p.regex.pattern))
|
|
||||||
except ViewDoesNotExist:
|
|
||||||
continue
|
|
||||||
elif hasattr(p, 'url_patterns'):
|
|
||||||
try:
|
try:
|
||||||
patterns = p.url_patterns
|
patterns = p.url_patterns
|
||||||
except ImportError:
|
except ImportError:
|
||||||
continue
|
continue
|
||||||
views.extend(extract_views_from_urlpatterns(patterns, base + p.regex.pattern))
|
views.extend(extract_views_from_urlpatterns(patterns, base + p.regex.pattern))
|
||||||
|
elif hasattr(p, 'callback'):
|
||||||
|
try:
|
||||||
|
views.append((p.callback, base + p.regex.pattern))
|
||||||
|
except ViewDoesNotExist:
|
||||||
|
continue
|
||||||
else:
|
else:
|
||||||
raise TypeError(_("%s does not appear to be a urlpattern object") % p)
|
raise TypeError(_("%s does not appear to be a urlpattern object") % p)
|
||||||
return views
|
return views
|
||||||
|
|
Loading…
Reference in New Issue