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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user