You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
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 differentfoo.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 asfoo_abC3412.png
alongside to the previousfoo.png
. After that if I upload another file namedfoo.png
it deletesfoo_abC3412.png
and replaces it with a file with a different name (for examplefoo_dEf3693
), so again twofoo
files exist, the first onefoo.png
and the newest onefoo_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.
The text was updated successfully, but these errors were encountered: