mirror of
https://github.com/wagtail/wagtail.git
synced 2024-11-25 13:10:14 +01:00
Added a flag in dummy_request() to inform middleware that the request is a dummy.
This is useful for middleware that perform destructive changes in process_response(). They rightfully expect process_response() to only get called once per thread, but it happens twice during a Page preview when running under Django 1.10's middleware system. This flag lets the middleware know that they should potentially skip their destructive operations. Conflicts: wagtail/wagtailcore/models.py
This commit is contained in:
parent
7c92ed7bad
commit
c8b0fff586
@ -1243,6 +1243,9 @@ class Page(AbstractPage, index.Indexed, ClusterableModel, metaclass=PageBase):
|
||||
|
||||
request = WSGIRequest(dummy_values)
|
||||
|
||||
# Add a flag to let middleware know that this is a dummy request.
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user