summaryrefslogtreecommitdiff
path: root/django/http
diff options
context:
space:
mode:
Diffstat (limited to 'django/http')
-rw-r--r--django/http/request.py10
-rw-r--r--django/http/response.py5
2 files changed, 4 insertions, 11 deletions
diff --git a/django/http/request.py b/django/http/request.py
index 4ca2ed25fa..6f3b0c9951 100644
--- a/django/http/request.py
+++ b/django/http/request.py
@@ -14,9 +14,7 @@ from django.core.files import uploadhandler
from django.http.multipartparser import MultiPartParser, MultiPartParserError
from django.utils import six
from django.utils.datastructures import ImmutableList, MultiValueDict
-from django.utils.encoding import (
- escape_uri_path, force_bytes, force_str, iri_to_uri,
-)
+from django.utils.encoding import escape_uri_path, force_bytes, iri_to_uri
from django.utils.http import is_same_domain, limited_parse_qsl
RAISE_ERROR = object()
@@ -64,10 +62,8 @@ class HttpRequest:
def __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()))
- )
+ return '<%s>' % self.__class__.__name__
+ return '<%s: %s %r>' % (self.__class__.__name__, self.method, self.get_full_path())
def _get_raw_host(self):
"""
diff --git a/django/http/response.py b/django/http/response.py
index c5294acbbd..e992adaed5 100644
--- a/django/http/response.py
+++ b/django/http/response.py
@@ -13,9 +13,7 @@ from django.core.exceptions import DisallowedRedirect
from django.core.serializers.json import DjangoJSONEncoder
from django.http.cookie import SimpleCookie
from django.utils import timezone
-from django.utils.encoding import (
- force_bytes, force_str, force_text, iri_to_uri,
-)
+from django.utils.encoding import force_bytes, force_text, iri_to_uri
from django.utils.http import cookie_date
_charset_from_content_type_re = re.compile(r';\s*charset=(?P<charset>[^\s;]+)', re.I)
@@ -170,7 +168,6 @@ class HttpResponseBase:
- an aware ``datetime.datetime`` object in any time zone.
If it is a ``datetime.datetime`` object then ``max_age`` will be calculated.
"""
- value = force_str(value)
self.cookies[key] = value
if expires is not None:
if isinstance(expires, datetime.datetime):