From f4cb7cb74f2252ae46268dc3195048f24bc2cdbd Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Wed, 26 Feb 2020 16:42:49 +0200 Subject: [PATCH] Collection item list: limit only to non-deleted by default. --- django_etesync/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/django_etesync/views.py b/django_etesync/views.py index b90b62e..b1bb18b 100644 --- a/django_etesync/views.py +++ b/django_etesync/views.py @@ -110,7 +110,9 @@ class CollectionItemViewSet(BaseViewSet): except Collection.DoesNotExist: raise Http404("Collection does not exist") # XXX Potentially add this for performance: .prefetch_related('revisions__chunks') - queryset = type(self).queryset.filter(collection__pk=collection.pk) + queryset = type(self).queryset.filter(collection__pk=collection.pk, + revisions__current=True, + revisions__isDeletion=False) return queryset