From: Guillaume Pellerin Date: Thu, 15 Jan 2026 09:49:50 +0000 (+0100) Subject: fix type, add print X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=c93e78b90ddcc6156d3fd1c6ed5fb471c89c8a85;p=teleforma.git fix type, add print --- diff --git a/teleforma/management/commands/teleforma-cleanup-private-documents.py b/teleforma/management/commands/teleforma-cleanup-private-documents.py index 314d25c1..5238a661 100644 --- a/teleforma/management/commands/teleforma-cleanup-private-documents.py +++ b/teleforma/management/commands/teleforma-cleanup-private-documents.py @@ -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")