Fixed -- Avoided unnecessary resolve() calls in technical_404_response().
Thanks Keryn Knight for the initial patch.
@@ -537,11 +537,13 @@ def technical_404_response(request, exception):
urlconf = urlconf.__name__
caller = ''
+ resolver_match = request.resolver_match
+ if resolver_match is None:
try:
resolver_match = resolve(request.path)
except Http404:
pass
- else:
+ if resolver_match is not None:
obj = resolver_match.func
if hasattr(obj, 'view_class'):
