1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

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.
This commit is contained in:
Baptiste Mispelon
2013-12-07 03:21:58 +01:00
parent ffc0e0ca37
commit a020dd0a99
4 changed files with 43 additions and 1 deletions

View File

@@ -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)