Fix new_cstoken getting for list functions.

We were getting the general cstoken, and were not honouring our limit.
This commit is contained in:
Tom Hacohen 2020-05-19 17:41:27 +03:00
parent 9bbb7ef3d7
commit aaee8f5e38

View File

@ -91,10 +91,11 @@ class BaseViewSet(viewsets.ModelViewSet):
else:
cstoken = None
queryset = queryset[:limit]
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
return queryset[:limit], new_cstoken
return queryset, new_cstoken
class CollectionViewSet(BaseViewSet):