Skip to content

Orphan images don't get removed if they have the same name as the new image #13

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

Open
stavlocker opened this issue Aug 6, 2018 · 2 comments

Comments

@stavlocker
Copy link

stavlocker commented Aug 6, 2018

Hello all.
I'm trying to use this to delete orphan image files on my ImageField, and everything is working fine with no errors and the images get deleted.
But, if my current file is foo.png for example, and I try to upload a different foo.png it doesn't delete the file from the media folder, it just creates a different file with a different name (as django does by default) such as foo_abC3412.png alongside to the previous foo.png. After that if I upload another file named foo.png it deletes foo_abC3412.png and replaces it with a file with a different name (for example foo_dEf3693), so again two foo files exist, the first one foo.png and the newest one foo_dEf3693.

Hence the problem is that if the uploaded image file is the same as the current one, it won't delete the current one.

@suhaibroomy
Copy link

Any update on this?

@lehins
Copy link
Owner

lehins commented Dec 11, 2019

Unfortunately I don't have much bandwidth to work on this project right now. @suhaibroomy do you wanna take a stab at this? At the very least if anyone is willing to add a test case that replicates this problem I'll try to find some time towards the end of the month/year in order to fix it.

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

3 participants