mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-11-05 06:19:25 +00:00
Fix: move versions of trashed documents
This commit is contained in:
1 parent
8e09e44b83
commit
eb297fe17e
1 file changed
+6
-4
@@ -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
|
||||
|
||||
Reference in new issue
Block a user