Fix new_cstoken getting for list functions.

We were getting the general cstoken, and were not honouring our limit.
master
Tom Hacohen 5 years ago
parent 9bbb7ef3d7
commit aaee8f5e38

@ -91,10 +91,11 @@ class BaseViewSet(viewsets.ModelViewSet):
else: else:
cstoken = None cstoken = None
queryset = queryset[:limit]
new_cstoken_id = queryset.aggregate(cstoken_id=Max(cstoken_id_field))['cstoken_id'] new_cstoken_id = queryset.aggregate(cstoken_id=Max(cstoken_id_field))['cstoken_id']
new_cstoken = CollectionItemRevision.objects.get(id=new_cstoken_id).uid if new_cstoken_id is not None else cstoken new_cstoken = CollectionItemRevision.objects.get(id=new_cstoken_id).uid if new_cstoken_id is not None else cstoken
return queryset[:limit], new_cstoken return queryset, new_cstoken
class CollectionViewSet(BaseViewSet): class CollectionViewSet(BaseViewSet):

Loading…
Cancel
Save