Remove checks for existence of collection
They are unnecessary since the discover methods stopped returning collections that actually don't exist.
This commit is contained in:
parent
e7d8b4816c
commit
f5650df5f7
@ -607,12 +607,7 @@ class Collection(BaseCollection):
|
|||||||
cls._sync_directory(item.collection._filesystem_path)
|
cls._sync_directory(item.collection._filesystem_path)
|
||||||
|
|
||||||
def list(self):
|
def list(self):
|
||||||
try:
|
for href in os.listdir(self._filesystem_path):
|
||||||
hrefs = os.listdir(self._filesystem_path)
|
|
||||||
except IOError:
|
|
||||||
return
|
|
||||||
|
|
||||||
for href in hrefs:
|
|
||||||
if not is_safe_filesystem_path_component(href):
|
if not is_safe_filesystem_path_component(href):
|
||||||
self.logger.debug("Skipping component: %s", href)
|
self.logger.debug("Skipping component: %s", href)
|
||||||
continue
|
continue
|
||||||
@ -653,7 +648,6 @@ class Collection(BaseCollection):
|
|||||||
def delete(self, href=None):
|
def delete(self, href=None):
|
||||||
if href is None:
|
if href is None:
|
||||||
# Delete the collection
|
# Delete the collection
|
||||||
if os.path.isdir(self._filesystem_path):
|
|
||||||
parent_dir = os.path.dirname(self._filesystem_path)
|
parent_dir = os.path.dirname(self._filesystem_path)
|
||||||
try:
|
try:
|
||||||
os.rmdir(self._filesystem_path)
|
os.rmdir(self._filesystem_path)
|
||||||
|
Loading…
Reference in New Issue
Block a user