#31201 closed Bug (wontfix)
Atomic Transaction Roll Back File Upload
Reported by: | Yash Jhunjhunwala | Owned by: | nobody |
---|---|---|---|
Component: | File uploads/storage | Version: | 2.2 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
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 |
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
For me, 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.