Commit 106ab671 authored by Samuel GAIST's avatar Samuel GAIST

[experiment][serializers] Ensure description is string

parent 968f6cff
Pipeline #21678 failed with stages
in 116 minutes and 39 seconds
......@@ -25,6 +25,8 @@
# #
###############################################################################
import six
from rest_framework import serializers
from django.contrib.humanize.templatetags.humanize import naturaltime
......@@ -275,13 +277,16 @@ class ExperimentResultsSerializer(ShareableSerializer):
return serializer.data
def get_html_description(self, obj):
d = obj.description.decode('utf-8')
d = self.get_description(obj)
if len(d) > 0:
return restructuredtext(d)
return ''
def get_description(self, obj):
return obj.description.decode('utf-8')
if not isinstance(obj.description, six.string_types):
return obj.description.decode('utf-8')
return obj.description
def get_display_start_date(self, obj):
if obj.start_date is None:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment