From: Guillaume Pellerin Date: Mon, 13 Jul 2026 22:13:37 +0000 (+0200) Subject: better script file delete X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=2e3c7a7f4c35985769992cf1450d4bb9555e50af;p=teleforma.git better script file delete --- 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