Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bulk delete doesn't cleanup files #9

Open
4lp opened this issue Oct 18, 2016 · 2 comments
Open

Bulk delete doesn't cleanup files #9

4lp opened this issue Oct 18, 2016 · 2 comments

Comments

@4lp
Copy link

4lp commented Oct 18, 2016

Hi! let me first just say I love this app. however, I noticed while playing with it that if I create a model with file or image fields, the automatic cleanup of the files only occurs if I delete the object from the database using the object's specific page in the admin page (http://url/admin//// - click 'delete' button) and does not occur with a batch delete from the model page (http://url/admin/// - select all then delete).

for my purposes this is okay for now as I'll be the only one using the admin site. just thought you'd want to know. thanks for your hard work!

@lehins
Copy link
Owner

lehins commented Oct 18, 2016

Glad you like it. I kind of figure that would be the case with bulk operations. Cleanup is handled by models delete() function, which is not triggered in bulk deletes:

The delete() method does a bulk delete and does not call any delete() methods on your models.

@4lp
Copy link
Author

4lp commented Oct 18, 2016

thanks, I figured it was something buried within Django I didn't completely understand. If I figure out a solution for bulk delete file cleanup I'll post it.

@lehins lehins changed the title file cleanup isn't consistent Bulk delete doesn't cleanup files Aug 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants