From 80c2d90e74408c8430fd053c8c1c945a2403f8bc Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Wed, 26 Jun 2024 19:30:12 -0700 Subject: [PATCH] Fix: dont include documents in trash in counts (#7111) --- src/documents/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/documents/views.py b/src/documents/views.py index affda436c..7457ce12f 100644 --- a/src/documents/views.py +++ b/src/documents/views.py @@ -231,10 +231,11 @@ class PermissionsAwareDocumentCountMixin(PassUserMixin): def get_queryset(self): filter = ( - None + Q(documents__deleted_at__isnull=True) if self.request.user is None or self.request.user.is_superuser else ( Q( + documents__deleted_at__isnull=True, documents__id__in=get_objects_for_user_owner_aware( self.request.user, "documents.view_document",