From a020dd0a99da13d0f024d42c46f01d8f503e9d5e Mon Sep 17 00:00:00 2001 From: Baptiste Mispelon Date: Sat, 7 Dec 2013 03:21:58 +0100 Subject: Fixed #21530 -- Prevent AttributeError in default URLconf detection code. Thanks to @dmyerscoug for the report and original patch and to @alasdairnicol for the added tests. --- django/views/debug.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'django') diff --git a/django/views/debug.py b/django/views/debug.py index 66453fe2c6..8f7f9dc00a 100644 --- a/django/views/debug.py +++ b/django/views/debug.py @@ -483,7 +483,7 @@ def technical_404_response(request, exception): or (request.path == '/' and len(tried) == 1 # default URLconf and len(tried[0]) == 1 - and tried[0][0].app_name == tried[0][0].namespace == 'admin')): + and getattr(tried[0][0], 'app_name', '') == getattr(tried[0][0], 'namespace', '') == 'admin')): return default_urlconf(request) urlconf = getattr(request, 'urlconf', settings.ROOT_URLCONF) -- cgit v1.3