From a539d434d9451eb201d8b79b45740e192c1736ca Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Fri, 12 Aug 2011 14:15:56 +0000 Subject: [PATCH] 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 --- django/contrib/admindocs/views.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/django/contrib/admindocs/views.py b/django/contrib/admindocs/views.py index 1f57900488..28319be9d5 100644 --- a/django/contrib/admindocs/views.py +++ b/django/contrib/admindocs/views.py @@ -349,17 +349,17 @@ def extract_views_from_urlpatterns(urlpatterns, base=''): """ views = [] for p in urlpatterns: - if hasattr(p, 'callback'): - try: - views.append((p.callback, base + p.regex.pattern)) - except ViewDoesNotExist: - continue - elif hasattr(p, 'url_patterns'): + if hasattr(p, 'url_patterns'): try: patterns = p.url_patterns except ImportError: continue 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: raise TypeError(_("%s does not appear to be a urlpattern object") % p) return views