mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
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:
committed by
Dave Page
parent
d9804ae2a2
commit
9e8e3fc787
@@ -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.'
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user