Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[py3] Removed excessive usage of smart_bytes

  • Loading branch information...
commit f8ea12f36b7f2e077887a1a02478ea24884b4514 1 parent 814fde3
@claudep claudep authored
Showing with 4 additions and 4 deletions.
  1. +2 −2 django/core/handlers/wsgi.py
  2. +2 −2 django/db/models/base.py
View
4 django/core/handlers/wsgi.py
@@ -9,7 +9,7 @@
from django.core.handlers import base
from django.core.urlresolvers import set_script_prefix
from django.utils import datastructures
-from django.utils.encoding import force_text, smart_bytes, iri_to_uri
+from django.utils.encoding import force_text, smart_str, iri_to_uri
from django.utils.log import getLogger
logger = getLogger('django.request')
@@ -246,5 +246,5 @@ def __call__(self, environ, start_response):
response_headers = [(str(k), str(v)) for k, v in response.items()]
for c in response.cookies.values():
response_headers.append((str('Set-Cookie'), str(c.output(header=''))))
- start_response(smart_bytes(status), response_headers)
+ start_response(smart_str(status), response_headers)
return response
View
4 django/db/models/base.py
@@ -23,7 +23,7 @@
from django.db.models.loading import register_models, get_model
from django.utils.translation import ugettext_lazy as _
from django.utils.functional import curry
-from django.utils.encoding import smart_bytes, smart_str, force_text
+from django.utils.encoding import smart_str, force_text
from django.utils import six
from django.utils.text import get_text_list, capfirst
@@ -654,7 +654,7 @@ def _get_next_or_previous_by_FIELD(self, field, is_next, **kwargs):
raise ValueError("get_next/get_previous cannot be used on unsaved objects.")
op = is_next and 'gt' or 'lt'
order = not is_next and '-' or ''
- param = smart_bytes(getattr(self, field.attname))
+ param = force_text(getattr(self, field.attname))
q = Q(**{'%s__%s' % (field.name, op): param})
q = q|Q(**{field.name: param, 'pk__%s' % op: self.pk})
qs = self.__class__._default_manager.using(self._state.db).filter(**kwargs).filter(q).order_by('%s%s' % (order, field.name), '%spk' % order)
Please sign in to comment.
Something went wrong with that request. Please try again.