1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #21564 -- Use local request object when possible in generic views.

Thanks to trac user adepue for the report and original patch.
This commit is contained in:
Baptiste Mispelon
2013-12-16 16:45:18 +01:00
parent 3eb58f0dd1
commit e2f142030b
2 changed files with 21 additions and 3 deletions

View File

@@ -90,7 +90,7 @@ class View(object):
logger.warning('Method Not Allowed (%s): %s', request.method, request.path,
extra={
'status_code': 405,
'request': self.request
'request': request
}
)
return http.HttpResponseNotAllowed(self._allowed_methods())
@@ -193,10 +193,10 @@ class RedirectView(View):
else:
return http.HttpResponseRedirect(url)
else:
logger.warning('Gone: %s', self.request.path,
logger.warning('Gone: %s', request.path,
extra={
'status_code': 410,
'request': self.request
'request': request
})
return http.HttpResponseGone()