Fix file selection on Windows. Fixes #1319

1) Unable to select sql file through query tool on windows OS. In file_manager.js, we are stripping initial slash '/' from the path obtained, but we should not strip if it is full path like 'c:/path/to/dir/filename.ext'

2) Handle directory path if STORAGE_DIR is None. Proper checks are added.
This commit is contained in:
Surinder Kumar
2016-06-10 17:06:22 +01:00
committed by Dave Page
parent d9804ae2a2
commit 9e8e3fc787
4 changed files with 24 additions and 10 deletions

View File

@@ -61,11 +61,11 @@ def init_app(app):
if storage_dir and not os.path.isdir(storage_dir):
if os.path.exists(storage_dir):
raise Exception(
'The value specified for as the storage directory is not a directory!'
'The path specified for the storage directory is not a directory.'
)
os.makedirs(storage_dir, int('700', 8))
if not os.access(storage_dir, os.W_OK | os.R_OK):
if storage_dir and not os.access(storage_dir, os.W_OK | os.R_OK):
raise Exception(
'The user does not have permission to read, write on the specified storage directory!'
'The user does not have permission to read and write to the specified storage directory.'
)