Browse Source

Fix force_text for py3

Denis K 9 years ago
parent
commit
02fb04689b
1 changed files with 3 additions and 2 deletions
  1. 3 2
      jet/utils.py

+ 3 - 2
jet/utils.py

@@ -5,7 +5,8 @@ from django.http import HttpResponse
 from django.core.urlresolvers import reverse, resolve
 from django.contrib import admin
 from django.contrib.admin import AdminSite
-from django.utils.encoding import force_unicode, smart_text
+from django.utils.encoding import force_text
+from django.utils.encoding import smart_text
 from django.utils.functional import Promise
 from jet import settings
 
@@ -74,7 +75,7 @@ def get_current_dashboard(location):
 class LazyEncoder(json.JSONEncoder):
     def default(self, obj):
         if isinstance(obj, Promise):
-            return force_unicode(obj)
+            return force_text(obj)
         return obj