mirror of https://github.com/django/django.git
Refs #24829 -- Removed TemplateResponse rendering in BaseHandler.get_response().
Obsolete since 742ea51413
.
This commit is contained in:
parent
3529d0eabf
commit
bff5ccff75
|
@ -72,23 +72,14 @@ class BaseHandler:
|
||||||
"""Return an HttpResponse object for the given HttpRequest."""
|
"""Return an HttpResponse object for the given HttpRequest."""
|
||||||
# Setup default url resolver for this thread
|
# Setup default url resolver for this thread
|
||||||
set_urlconf(settings.ROOT_URLCONF)
|
set_urlconf(settings.ROOT_URLCONF)
|
||||||
|
|
||||||
response = self._middleware_chain(request)
|
response = self._middleware_chain(request)
|
||||||
|
|
||||||
response._closable_objects.append(request)
|
response._closable_objects.append(request)
|
||||||
|
|
||||||
# If the exception handler returns a TemplateResponse that has not
|
|
||||||
# been rendered, force it to be rendered.
|
|
||||||
if not getattr(response, 'is_rendered', True) and callable(getattr(response, 'render', None)):
|
|
||||||
response = response.render()
|
|
||||||
|
|
||||||
if response.status_code >= 400:
|
if response.status_code >= 400:
|
||||||
log_response(
|
log_response(
|
||||||
'%s: %s', response.reason_phrase, request.path,
|
'%s: %s', response.reason_phrase, request.path,
|
||||||
response=response,
|
response=response,
|
||||||
request=request,
|
request=request,
|
||||||
)
|
)
|
||||||
|
|
||||||
return response
|
return response
|
||||||
|
|
||||||
def _get_response(self, request):
|
def _get_response(self, request):
|
||||||
|
|
Loading…
Reference in New Issue