Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

added progress bar to the document renamer.

jonaswinklerb3daf0efc331
diff --git a/src/documents/management/commands/document_renamer.py b/src/documents/management/commands/document_renamer.py
index ba9e74de5..5d7d0d90c 100644
--- a/src/documents/management/commands/document_renamer.py
+++ b/src/documents/management/commands/document_renamer.py
@@ -1,3 +1,6 @@
+import logging
+
+import tqdm
from django.core.management.base import BaseCommand
from documents.models import Document
@@ -18,6 +21,8 @@ class Command(Renderable, BaseCommand):
self.verbosity = options["verbosity"]
- for document in Document.objects.all():
+ logging.getLogger().handlers[0].level = logging.ERROR
+
+ for document in tqdm.tqdm(Document.objects.all()):
# Saving the document again will generate a new filename and rename
document.save()