Skip to content

Commit 58f02da

Browse files
author
Cucu
committed
Implementation of file_exists new uses MultiStorageFieldFile.name rather than filer.File.path
Apparently many storage backends don't implement path. Looking at the docstring in django.core.files.Storage.path, this makes sense: "Storage systems that can't be accessed using open() should *not* implement this method" MultiStorageFieldFile.name works correctly with multiple storage backends
1 parent af4fb20 commit 58f02da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmsplugin_filer_file/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def get_icon_url(self):
3636
return self.file.icons['32']
3737

3838
def file_exists(self):
39-
return self.file.file.storage.exists(self.file.path)
39+
return self.file.file.storage.exists(self.file.file.name)
4040

4141
def get_file_name(self):
4242
if self.file.name in ('', None):

0 commit comments

Comments
 (0)