Coverage for documents/management/commands/document_renamer.py: 0%
10 statements
« prev ^ index » next coverage.py v7.15.2, created at 2026-10-10 09:07 +0000
« prev ^ index » next coverage.py v7.15.2, created at 2026-10-10 09:07 +0000
1from django.db.models.signals import post_save
3from documents.management.commands.base import PaperlessCommand
4from documents.models import Document
7class Command(PaperlessCommand):
8 help = "Rename all documents"
10 supports_progress_bar = True
11 supports_multiprocessing = False
13 def handle(self, *args, **options):
14 for document in self.track(Document.objects.all(), description="Renaming..."):
15 post_save.send(Document, instance=document, created=False)