Commit a850544e authored by Serge S. Koval's avatar Serge S. Koval

Fixed #27

parent 75f09a80
......@@ -132,7 +132,8 @@ class FileAdmin(BaseView, ActionsMixin):
"""
def __init__(self, base_path, base_url,
name=None, category=None, endpoint=None, url=None):
name=None, category=None, endpoint=None, url=None,
verify_path=True):
"""
Constructor.
......@@ -148,6 +149,9 @@ class FileAdmin(BaseView, ActionsMixin):
Endpoint name for the view
`url`
URL for view
`verify_path`
Verify if path exists. If set to `True` and path does not exist
will throw exception.
"""
self.base_path = base_path
self.base_url = base_url
......@@ -161,6 +165,10 @@ class FileAdmin(BaseView, ActionsMixin):
and not isinstance(self.allowed_extensions, set)):
self.allowed_extensions = set(self.allowed_extensions)
# Check if path exists
if not op.exists(base_path):
raise IOError('FileAdmin path "%s" does not exist or is not accessible' % base_path)
super(FileAdmin, self).__init__(name, category, endpoint, url)
def is_accessible_path(self, path):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment