Item revisions: never return the current revision, only old ones.

This commit is contained in:
Tom Hacohen 2020-06-23 18:04:49 +03:00
parent 317c492688
commit 786948c456

View File

@ -275,7 +275,8 @@ class CollectionItemViewSet(BaseViewSet):
col = get_object_or_404(self.get_collection_queryset(Collection.objects), main_item__uid=collection_uid)
col_it = get_object_or_404(col.items, uid=uid)
serializer = CollectionItemRevisionSerializer(col_it.revisions.order_by('-id'), many=True)
revisions = col_it.revisions.exclude(current=True).order_by('-id')
serializer = CollectionItemRevisionSerializer(revisions, many=True)
ret = {
'data': serializer.data,
'done': True, # we always return all the items, so it's always done