🐛(backend) fix trashbin list

Fix listing of deleted documents in trashbin for
users without owner access
This commit is contained in:
Anthony LC
2025-10-23 12:03:31 +02:00
parent 145c688830
commit dd56a8abeb
3 changed files with 30 additions and 0 deletions

View File

@@ -636,6 +636,9 @@ class DocumentViewSet(
.values_list("document__path", flat=True)
)
if not access_documents_paths:
return self.get_response_for_queryset(self.queryset.none())
children_clause = db.Q()
for path in access_documents_paths:
children_clause |= db.Q(path__startswith=path)