Skip to content
Snippets Groups Projects
Commit dac780d1 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[common][serializers] Fix decoding handling for description

parent 8dd2ffc8
No related branches found
No related tags found
2 merge requests!2551.4.x,!242Py3 compatibility
...@@ -257,7 +257,10 @@ class ContributionSerializer(VersionableSerializer): ...@@ -257,7 +257,10 @@ class ContributionSerializer(VersionableSerializer):
exclude = ['description_file', 'declaration_file'] exclude = ['description_file', 'declaration_file']
def get_description(self, obj): def get_description(self, obj):
return obj.description.decode('utf-8') result = obj.description
if six.PY2:
result = result.decode('utf-8')
return result
def get_declaration(self, obj): def get_declaration(self, obj):
object_format = self.context.get('object_format') object_format = self.context.get('object_format')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment