]> git.parisson.com Git - teleforma.git/commitdiff
fix type, add print
authorGuillaume Pellerin <yomguy@parisson.com>
Thu, 15 Jan 2026 09:49:50 +0000 (10:49 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Thu, 15 Jan 2026 09:49:50 +0000 (10:49 +0100)
teleforma/management/commands/teleforma-cleanup-private-documents.py

index 314d25c1c083e618d8290521b2cb4e6ce4957058..5238a6615f0bb01e32ed02ce36273291ecf0808e 100644 (file)
@@ -11,7 +11,10 @@ class Command(BaseCommand):
         parser.add_argument('args', nargs='*')
 
     def handle(self, *args, **options):
-        days = args[0]
+        days = int(args[0])
         date_limit = datetime.today() - timedelta(days=days)
-        for document in DocumentPrivate.objects.filter(date_added__lte=date_limit):
+        documents = DocumentPrivate.objects.filter(date_added__lte=date_limit)
+        print("num of docs: ", documents.count())
+        for document in documents:
             document.delete()
+            print(document.id, "deleted")