#31201 closed Bug (wontfix)
Atomic Transaction Roll Back File Upload
Description ¶
For a Model A with FileField
Model A(models.Model) file_field = models.FileField()
Save an instance of model A under a transaction block,
If the transaction fails i.e not committed/rollback , the uploaded file is not deleted, even though the instance of the model is not saved
Change History (2)
comment:1 by , 5 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Version 0, edited 5 years ago by (next)
comment:2 by , 5 years ago
Component: | Uncategorized → File uploads/storage |
---|
Note:
See TracTickets
for help on using tickets.
This is long-standing behavior, I'm afraid.
FileField docs:
c.f. Malcolm Tredinnick on https://code.djangoproject.com/ticket/11663#comment:14
Just quickly trying to think about how one might tie the transaction rollback into the file upload handling, a periodic cleanup command is instantly more appealing. I hope that makes sense.