summaryrefslogtreecommitdiff
path: root/django/http/request.py
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2014-11-20 11:28:16 +0200
committerTim Graham <timograham@gmail.com>2014-11-20 08:45:11 -0500
commit788fa9fffa0105d391b8fe35f2894bc5b4e29066 (patch)
tree63df8a6ab2c70c2a8b67ab3e202010ed5e3a3bdb /django/http/request.py
parentd6e2bbe734fe65f1cec825b9c507ad7bbb09f2f0 (diff)
Fixed #12098 -- Simplified HttpRequest.__repr__().
Diffstat (limited to 'django/http/request.py')
-rw-r--r--django/http/request.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/django/http/request.py b/django/http/request.py
index 486eeb5410..0ef90a1954 100644
--- a/django/http/request.py
+++ b/django/http/request.py
@@ -64,7 +64,11 @@ class HttpRequest(object):
self._post_parse_error = False
def __repr__(self):
- return build_request_repr(self)
+ if self.method is None or not self.get_full_path():
+ return force_str('<%s>' % self.__class__.__name__)
+ return force_str(
+ '<%s: %s %r>' % (self.__class__.__name__, self.method, force_str(self.get_full_path()))
+ )
def get_host(self):
"""Returns the HTTP host using the environment or request headers."""