Skip to content

Commit

Permalink
django 1 compatability changes
Browse files Browse the repository at this point in the history
  • Loading branch information
RonShub committed Aug 27, 2023
1 parent 90c1dd2 commit 761d68c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions jsonfield/encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from django.db.models.query import QuerySet
from django.utils import timezone
from django.utils.encoding import force_text
from django.utils.encoding import force_str
from django.utils.functional import Promise


Expand All @@ -22,7 +22,7 @@ def default(self, obj): # noqa
# For Date Time string spec, see ECMA 262
# http://ecma-international.org/ecma-262/5.1/#sec-15.9.1.15
if isinstance(obj, Promise):
return force_text(obj)
return force_str(obj)
elif isinstance(obj, datetime.datetime):
representation = obj.isoformat()
if obj.microsecond:
Expand Down
2 changes: 1 addition & 1 deletion jsonfield/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from django.db import models
from django.forms import fields
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

from .encoder import JSONEncoder
from .subclassing import SubfieldBase
Expand Down

0 comments on commit 761d68c

Please sign in to comment.