Fix: rename only root documents in document_renamer

This commit is contained in:
Trenton H authored and stumpylog committed 2026-11-09 12:25:21 -08:00
1 parent 6a356fddec
commit 4b3673552e
1 file changed
+2 -1
@@ -11,7 +11,8 @@ class Command(PaperlessCommand):
def handle(self, *args, **options):
for document in self.track(
Document.objects.only("pk"),
# move_files_for_document handles a root's versions itself
Document.objects.filter(root_document__isnull=True).only("pk"),
description="Renaming...",
):
move_files_for_document(document.pk)