Fix: move versions of trashed documents

This commit is contained in:
Trenton H committed 2026-11-04 20:11:03 -08:00
1 parent 8e09e44b83
commit eb297fe17e
1 file changed
+6 -4
+6 -4
View File
@@ -152,10 +152,12 @@ def move_files_for_document(pk: int) -> Document | None:
# Keep version files in sync with root
if document.root_document_id is None:
for version_pk in Document.objects.filter(root_document_id=pk).values_list(
"pk",
flat=True,
):
version_pks = list(
Document.global_objects.values_list("pk", flat=True).filter(
root_document_id=pk,
),
)
for version_pk in version_pks:
move_files_for_document(version_pk)
return document