Refs #23919 -- Removed force_text() in Python deserializer needed only on Python 2
This commit is contained in:
parent
a8343fe7bf
commit
59f8118c86
|
@ -6,7 +6,6 @@ other serializers.
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
from django.apps import apps
|
from django.apps import apps
|
||||||
from django.conf import settings
|
|
||||||
from django.core.serializers import base
|
from django.core.serializers import base
|
||||||
from django.db import DEFAULT_DB_ALIAS, models
|
from django.db import DEFAULT_DB_ALIAS, models
|
||||||
from django.utils.encoding import force_text, is_protected_type
|
from django.utils.encoding import force_text, is_protected_type
|
||||||
|
@ -116,11 +115,6 @@ def Deserializer(object_list, *, using=DEFAULT_DB_ALIAS, ignorenonexistent=False
|
||||||
# skip fields no longer on model
|
# skip fields no longer on model
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if isinstance(field_value, str):
|
|
||||||
field_value = force_text(
|
|
||||||
field_value, options.get("encoding", settings.DEFAULT_CHARSET), strings_only=True
|
|
||||||
)
|
|
||||||
|
|
||||||
field = Model._meta.get_field(field_name)
|
field = Model._meta.get_field(field_name)
|
||||||
|
|
||||||
# Handle M2M relations
|
# Handle M2M relations
|
||||||
|
|
Loading…
Reference in New Issue