summaryrefslogtreecommitdiff
path: root/django/utils
diff options
context:
space:
mode:
authorJonny Park <jonnythebard9@gmail.com>2021-03-10 14:33:52 +0900
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-03-10 21:16:58 +0100
commitdc86a25a677d05703e0bb021b178e44412cea7e9 (patch)
treed3ef89ca31bacd1481ca63337e6e8c4a3b27d023 /django/utils
parentbc43ae7c13b903022ec1fcb4867f5f10d7f125d6 (diff)
Refs #24121 -- Added __repr__() to MiddlewareMixin and subclasses.
Diffstat (limited to 'django/utils')
-rw-r--r--django/utils/deprecation.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/django/utils/deprecation.py b/django/utils/deprecation.py
index 05913ab4ba..08f33fa7d3 100644
--- a/django/utils/deprecation.py
+++ b/django/utils/deprecation.py
@@ -96,6 +96,16 @@ class MiddlewareMixin:
self._async_check()
super().__init__()
+ def __repr__(self):
+ return '<%s get_response=%s>' % (
+ self.__class__.__qualname__,
+ getattr(
+ self.get_response,
+ '__qualname__',
+ self.get_response.__class__.__name__,
+ ),
+ )
+
def _async_check(self):
"""
If get_response is a coroutine function, turns us into async mode so