]> git.parisson.com Git - teleforma.git/commitdiff
better script file delete
authorGuillaume Pellerin <guillaume.pellerin@parisson.com>
Mon, 13 Jul 2026 22:13:37 +0000 (00:13 +0200)
committerGuillaume Pellerin <guillaume.pellerin@parisson.com>
Mon, 13 Jul 2026 22:13:37 +0000 (00:13 +0200)
teleforma/management/commands/teleforma-delete-year-scripts.py

index eb7be414e8526be8dc556d1b5c355f083af870ea..085795454c8ebcd7eccc954dfa8717bc0dea4860 100644 (file)
@@ -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