Fix: dont include documents in trash in counts (#7111)

This commit is contained in:
shamoon 2024-06-26 19:30:12 -07:00 committed by GitHub
parent f3cf608caa
commit 80c2d90e74
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -231,10 +231,11 @@ class PermissionsAwareDocumentCountMixin(PassUserMixin):
def get_queryset(self): def get_queryset(self):
filter = ( filter = (
None Q(documents__deleted_at__isnull=True)
if self.request.user is None or self.request.user.is_superuser if self.request.user is None or self.request.user.is_superuser
else ( else (
Q( Q(
documents__deleted_at__isnull=True,
documents__id__in=get_objects_for_user_owner_aware( documents__id__in=get_objects_for_user_owner_aware(
self.request.user, self.request.user,
"documents.view_document", "documents.view_document",