From a0d1291031254a39eb9240f66758c2cf94e3c8c0 Mon Sep 17 00:00:00 2001 From: Samuel Gaist <samuel.gaist@idiap.ch> Date: Thu, 26 Apr 2018 15:51:40 +0200 Subject: [PATCH] [plotters][serializers] Use smart_text in place of smart_unicode --- beat/web/plotters/serializers.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/beat/web/plotters/serializers.py b/beat/web/plotters/serializers.py index 5f79e3ca8..11f14e3ff 100644 --- a/beat/web/plotters/serializers.py +++ b/beat/web/plotters/serializers.py @@ -33,7 +33,8 @@ from ..code.serializers import CodeSerializer, CodeCreationSerializer from ..libraries.serializers import LibraryReferenceSerializer from ..dataformats.serializers import ReferencedDataFormatSerializer -from django.utils.encoding import smart_unicode, smart_str +from django.utils.encoding import smart_str +from django.utils.encoding import smart_text import beat.core.plotter import simplejson as json @@ -205,10 +206,10 @@ class FullPlotterParameterSerializer(PlotterParameterAllSerializer): default_fields = ['id', 'accessibility', 'modifiable', 'deletable', 'is_owner', 'name', 'fork_of', 'last_version', 'previous_version', 'short_description', 'description', 'version', 'creation_date', 'data', 'plotter', 'plotters'] def get_description(self, obj): - return smart_unicode(obj.description, encoding='utf-8', strings_only=False, errors='strict') + return smart_text(obj.description, encoding='utf-8', strings_only=False, errors='strict') def get_short_description(self, obj): - return smart_unicode(obj.short_description, encoding='utf-8', strings_only=False, errors='strict') + return smart_text(obj.short_description, encoding='utf-8', strings_only=False, errors='strict') def get_data(self, obj): return json.loads(obj.data) -- GitLab