From aaee8f5e381f688dd37c8bccc467a37917ad1dc0 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 19 May 2020 17:41:27 +0300 Subject: [PATCH] Fix new_cstoken getting for list functions. We were getting the general cstoken, and were not honouring our limit. --- django_etesync/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/django_etesync/views.py b/django_etesync/views.py index aa3c148..5a4101c 100644 --- a/django_etesync/views.py +++ b/django_etesync/views.py @@ -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):