Skip to content

Commit dd2afc1

Browse files
committed
Fixed undefined function
1 parent f5aef9d commit dd2afc1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

django_ajax/encoder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from datetime import date
88
from django.http.response import HttpResponseRedirectBase, HttpResponse
99
from django.template.response import TemplateResponse
10-
from django.utils.encoding import force_text
10+
from django.utils.encoding import force_str
1111
from django.db.models.base import ModelBase
1212
from decimal import Decimal
1313

@@ -28,7 +28,7 @@ def default(self, obj):
2828
elif issubclass(type(obj), HttpResponse):
2929
return obj.content
3030
elif issubclass(type(obj), Exception) or isinstance(obj, bytes):
31-
return force_text(obj)
31+
return force_str(obj)
3232

3333
# this handles querysets and other iterable types
3434
try:
@@ -40,7 +40,7 @@ def default(self, obj):
4040

4141
# this handlers Models
4242
if isinstance(obj.__class__, ModelBase):
43-
return force_text(obj)
43+
return force_str(obj)
4444

4545
if isinstance(obj, Decimal):
4646
return float(obj)

0 commit comments

Comments
 (0)