mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-03-16 22:10:28 +00:00
Remove handling of MIDDLEWARE_CLASSES. (#4903)
Unneeded since e844200f27.
This commit is contained in:
parent
f76f41ea01
commit
1ff6a5003a
1 changed files with 3 additions and 13 deletions
|
|
@ -1269,19 +1269,9 @@ class Page(AbstractPage, index.Indexed, ClusterableModel, metaclass=PageBase):
|
|||
request.is_dummy = True
|
||||
|
||||
# Apply middleware to the request
|
||||
# Note that Django makes sure only one of the middleware settings are
|
||||
# used in a project
|
||||
if hasattr(settings, 'MIDDLEWARE'):
|
||||
handler = BaseHandler()
|
||||
handler.load_middleware()
|
||||
handler._middleware_chain(request)
|
||||
elif hasattr(settings, 'MIDDLEWARE_CLASSES'):
|
||||
# Pre Django 1.10 style - see http://www.mellowmorning.com/2011/04/18/mock-django-request-for-testing/
|
||||
handler = BaseHandler()
|
||||
handler.load_middleware()
|
||||
# call each middleware in turn and throw away any responses that they might return
|
||||
for middleware_method in handler._request_middleware:
|
||||
middleware_method(request)
|
||||
handler = BaseHandler()
|
||||
handler.load_middleware()
|
||||
handler._middleware_chain(request)
|
||||
|
||||
return request
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue