sehmaschine / django-filebrowser

Media-Management with Grappelli
http://twitter.com/sehmaschine
Other
976 stars 408 forks source link

Add site.directory to version_path #389

Closed raagin closed 3 years ago

raagin commented 4 years ago

Hi! I suggest this, because if you use version tag in template it is generate version path with site.directory but if you use fileobject.version_generate(version_suffix) in views for example, generated path will be another one (without site.directory). And also, if directory of the custom site have the same name with folder created inside default site in _versions directory, it will be the same folder. It is ok, if only one site is exists, but for many sites it can produce mistakes. Thank you.

raagin commented 4 years ago

I'm not shure that is the correct way and place where to set it, but problem is exists.

sehmaschine commented 4 years ago

Just (very briefly) checked the code and fileobject.version_generate is using fileobject.versions_basedir which again refers to site.directory. Besides, there are tests (see tests_base) checking the method.

Do you want to add a test case which shows what you're trying to achieve (resp. shows the bug with the current tests)?

sehmaschine commented 3 years ago

Checked this again and the templatetags use fileobject.version_generate. Therefore, the result cannot be different. Besides, your proposed change breaks almost all test cases. I'm closing this for now. Please add some test cases if you think this is an issue (I currently think it is not).