summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
Diffstat (limited to 'django')
-rw-r--r--django/utils/deprecation.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/django/utils/deprecation.py b/django/utils/deprecation.py
index 3582fcf3a3..b2c681b33c 100644
--- a/django/utils/deprecation.py
+++ b/django/utils/deprecation.py
@@ -126,10 +126,16 @@ class MiddlewareMixin:
"""
response = None
if hasattr(self, 'process_request'):
- response = await sync_to_async(self.process_request)(request)
+ response = await sync_to_async(
+ self.process_request,
+ thread_sensitive=True,
+ )(request)
response = response or await self.get_response(request)
if hasattr(self, 'process_response'):
- response = await sync_to_async(self.process_response)(request, response)
+ response = await sync_to_async(
+ self.process_response,
+ thread_sensitive=True,
+ )(request, response)
return response
def _get_response_none_deprecation(self, get_response):