🧵(backend) improve robustness of the delete file process

* Make the call the delete celery task after the transaction
this makes sure the file object is in the right
state before being deleted.
This commit is contained in:
Florent Chehab
2026-06-04 11:39:34 +02:00
parent 5602d256d8
commit 8d653b30e5
+1 -1
View File
@@ -1326,7 +1326,7 @@ class FileViewSet(
"""Delete a file completely."""
file.soft_delete()
file.hard_delete()
process_file_deletion.delay(file.id)
transaction.on_commit(lambda: process_file_deletion.delay(file.id))
def _authorize_subrequest(self, request, pattern):
"""