Skip non-directories during filesystem discovery

This commit is contained in:
Markus Unterwaditzer 2014-11-30 16:02:01 +01:00
parent 11919ef30d
commit 29f9a10766

View file

@ -54,8 +54,9 @@ class FilesystemStorage(Storage):
raise TypeError('collection argument must not be given.')
path = expand_path(path)
for collection in os.listdir(path):
s = cls(path=path, collection=collection, **kwargs)
yield s
if os.path.isdir(os.path.join(path, collection)):
s = cls(path=path, collection=collection, **kwargs)
yield s
def _get_filepath(self, href):
return os.path.join(self.path, href)