summaryrefslogtreecommitdiff
path: root/django/http/request.py
diff options
context:
space:
mode:
authorVlastimil Zíma <vlastimil.zima@nic.cz>2015-07-09 17:27:07 +0200
committerTim Graham <timograham@gmail.com>2015-07-13 19:22:39 -0400
commit8f8c54f70bfa3aa8e311514297f1eeded2c32593 (patch)
tree72eae0d9d26837e4cd43668b3e79b63b4c5ae129 /django/http/request.py
parent6bdd3840be63582531c3125a26cd00294e6f8346 (diff)
Fixed #25099 -- Cleaned up HttpRequest representations in error reporting.
Diffstat (limited to 'django/http/request.py')
-rw-r--r--django/http/request.py47
1 files changed, 0 insertions, 47 deletions
diff --git a/django/http/request.py b/django/http/request.py
index fbd355eeff..3f23077565 100644
--- a/django/http/request.py
+++ b/django/http/request.py
@@ -5,7 +5,6 @@ import re
import sys
from io import BytesIO
from itertools import chain
-from pprint import pformat
from django.conf import settings
from django.core import signing
@@ -465,52 +464,6 @@ class QueryDict(MultiValueDict):
return '&'.join(output)
-def build_request_repr(request, path_override=None, GET_override=None,
- POST_override=None, COOKIES_override=None,
- META_override=None):
- """
- Builds and returns the request's representation string. The request's
- attributes may be overridden by pre-processed values.
- """
- # Since this is called as part of error handling, we need to be very
- # robust against potentially malformed input.
- try:
- get = (pformat(GET_override)
- if GET_override is not None
- else pformat(request.GET))
- except Exception:
- get = '<could not parse>'
- if request._post_parse_error:
- post = '<could not parse>'
- else:
- try:
- post = (pformat(POST_override)
- if POST_override is not None
- else pformat(request.POST))
- except Exception:
- post = '<could not parse>'
- try:
- cookies = (pformat(COOKIES_override)
- if COOKIES_override is not None
- else pformat(request.COOKIES))
- except Exception:
- cookies = '<could not parse>'
- try:
- meta = (pformat(META_override)
- if META_override is not None
- else pformat(request.META))
- except Exception:
- meta = '<could not parse>'
- path = path_override if path_override is not None else request.path
- return force_str('<%s\npath:%s,\nGET:%s,\nPOST:%s,\nCOOKIES:%s,\nMETA:%s>' %
- (request.__class__.__name__,
- path,
- six.text_type(get),
- six.text_type(post),
- six.text_type(cookies),
- six.text_type(meta)))
-
-
# It's neither necessary nor appropriate to use
# django.utils.encoding.smart_text for parsing URLs and form inputs. Thus,
# this slightly more restricted function, used by QueryDict.