Commit 11d1d93f authored by Florent Chehab's avatar Florent Chehab
Browse files

Bug corrected in how pending moderation were displayed

parent ec10ad21
......@@ -41,12 +41,13 @@ class MyModelSerializer(MySerializerWithJSON):
return self.Meta.model.model_config
def get_pending_moderation(self, obj):
pm = PendingModerationSerializer(
obj.pending_moderation, many=True, read_only=True, context=self.context).data
if self.context['view'].action == 'list':
return len(pm)
return None
return pm
ct = ContentType.objects.get_for_model(self.Meta.model)
pending = PendingModeration.objects.filter(
return PendingModerationSerializer(pending, many=True, read_only=True, context=self.context).data
def get_id(self, obj):
......@@ -64,7 +64,6 @@ class VersionSerializer(MySerializerWithJSON):
tmp = list(djangoSerializers.deserialize(
obj.format, data, ignorenonexistent=True))[0]
# Version is valid,
obj_serializer = tmp.object.get_serializer()
new_context = dict(self.context)
Supports Markdown
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