From c93e78b90ddcc6156d3fd1c6ed5fb471c89c8a85 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Thu, 15 Jan 2026 10:49:50 +0100 Subject: [PATCH] fix type, add print --- .../commands/teleforma-cleanup-private-documents.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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") -- 2.39.5