Closed vartagg closed 6 years ago
Trying to install with Django 1.11 actually uninstalls that version, and installs 1.10.7 instead.
@beaumartinez Working with Django 1.11 was fixed by #11 in version 0.1.7, available in PyPi
@vartagg Thanks for contribution!
Based on your MR, I made some fixes.
And plugin is working with absolute path, even in tests absolute path is using.
Yes, it is. But unfortunately, tests do not cover this bug. If you test with at least such parameters:
images/1/2017/image.jpg
audio/10/2016/foo.mp3
django application directory
or its subdirectories.I sure that the last is a key parameter, because I saw in Debugger when images/1/2017/image.jpg
(stored in fileobj.url
) is comparing with something like ../../../images/1/2017/image.jpg
("relative path" of file provided by os.path
module when MEDIA_ROOT
path was higher then django application directory in filesystem tree) so comparison function didn't detect this because ../../../images/1/2017/image.jpg
is not a real path bound with some django file field object. So, everything in MEDIA_ROOT
(after confirmation and on test environment, what is good) is deleted.
Fixed in version 0.1.8.
MEDIA_ROOT
declared as absolute path, it deleting everything inMEDIA_ROOT
remove_empty_dirs
should be optional command argumenty
)My PR with fixes #9