From 2e3c7a7f4c35985769992cf1450d4bb9555e50af Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Tue, 14 Jul 2026 00:13:37 +0200 Subject: [PATCH] better script file delete --- teleforma/management/commands/teleforma-delete-year-scripts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/teleforma/management/commands/teleforma-delete-year-scripts.py b/teleforma/management/commands/teleforma-delete-year-scripts.py index eb7be414..08579545 100644 --- a/teleforma/management/commands/teleforma-delete-year-scripts.py +++ b/teleforma/management/commands/teleforma-delete-year-scripts.py @@ -21,6 +21,6 @@ class Command(BaseCommand): date = datetime.datetime(day=31, month=12, year=year) scripts = Script.objects.filter(date_added__lte=date) for script in scripts: - os.remove(script.file.path) + script.file.delete(save=False) script.delete() \ No newline at end of file -- 2.47.3