(backend) add command to clean pending and deleted files

Since we have added custom backgrounds, they could be
soft deleted but were never really deleted.
This commits introduces a command to actually delete
this files.
In introduces also a command to purge pending upload
.
This commit is contained in:
Florent Chehab
2026-06-03 17:38:09 +02:00
parent 898bc9a0f8
commit 5c15140783
8 changed files with 274 additions and 2 deletions
+4 -1
View File
@@ -1187,7 +1187,10 @@ class FileViewSet(
serializer.save(creator=self.request.user)
def perform_destroy(self, instance):
"""Override to implement a soft delete instead of dumping the record in database."""
"""Override to implement a soft delete instead of dumping the record in database.
Files are actually purged by commands that should run periodically.
"""
instance.soft_delete()
@decorators.action(detail=True, methods=["post"], url_path="upload-ended")