mirror of
https://github.com/graphql-python/graphene-django.git
synced 2024-11-28 20:43:43 +03:00
resolve django encoding deprecation warnings (#853)
https://docs.djangoproject.com/en/3.0/ref/utils/#django.utils.encoding.force_text
This commit is contained in:
parent
08f67797d8
commit
62ecbae614
|
@ -6,7 +6,7 @@ from threading import local
|
|||
from time import time
|
||||
|
||||
import six
|
||||
from django.utils.encoding import force_text
|
||||
from django.utils.encoding import force_str
|
||||
|
||||
from .types import DjangoDebugSQL
|
||||
|
||||
|
@ -78,7 +78,7 @@ class NormalCursorWrapper(object):
|
|||
|
||||
def _quote_expr(self, element):
|
||||
if isinstance(element, six.string_types):
|
||||
return "'%s'" % force_text(element).replace("'", "''")
|
||||
return "'%s'" % force_str(element).replace("'", "''")
|
||||
else:
|
||||
return repr(element)
|
||||
|
||||
|
@ -91,7 +91,7 @@ class NormalCursorWrapper(object):
|
|||
|
||||
def _decode(self, param):
|
||||
try:
|
||||
return force_text(param, strings_only=True)
|
||||
return force_str(param, strings_only=True)
|
||||
except UnicodeDecodeError:
|
||||
return "(encoded string)"
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user