mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-22 08:46:39 -06:00
Ensure that the dump servers functionality works from setup.py. Fixes #7644
This commit is contained in:
parent
e58b9c767b
commit
72f819ec67
@ -18,4 +18,5 @@ Housekeeping
|
||||
Bug fixes
|
||||
*********
|
||||
|
||||
| `Issue #7644 <https://redmine.postgresql.org/issues/7644>`_ - Ensure that the dump servers functionality works from setup.py.
|
||||
| `Issue #7646 <https://redmine.postgresql.org/issues/7646>`_ - Ensure that the Import/Export server menu option is visible.
|
||||
|
@ -677,8 +677,8 @@ class Filemanager(object):
|
||||
return files
|
||||
|
||||
@staticmethod
|
||||
def check_access_permission(in_dir, path):
|
||||
if not config.SERVER_MODE:
|
||||
def check_access_permission(in_dir, path, skip_permission_check=False):
|
||||
if not config.SERVER_MODE or skip_permission_check:
|
||||
return
|
||||
|
||||
in_dir = '' if in_dir is None else in_dir
|
||||
|
@ -443,7 +443,8 @@ def dump_database_servers(output_file, selected_servers,
|
||||
|
||||
from pgadmin.misc.file_manager import Filemanager
|
||||
try:
|
||||
Filemanager.check_access_permission(storage_manager_path, file_path)
|
||||
Filemanager.check_access_permission(storage_manager_path, file_path,
|
||||
from_setup)
|
||||
except Exception as e:
|
||||
return _handle_error(str(e), from_setup)
|
||||
|
||||
@ -732,14 +733,14 @@ def _does_user_exist(user, from_setup):
|
||||
if isinstance(user, User):
|
||||
user = user.email
|
||||
|
||||
user = User.query.filter_by(email=user).first()
|
||||
new_user = User.query.filter_by(email=user).first()
|
||||
|
||||
if user is None:
|
||||
if new_user is None:
|
||||
print(USER_NOT_FOUND % user)
|
||||
if from_setup:
|
||||
sys.exit(1)
|
||||
|
||||
return user
|
||||
return new_user
|
||||
|
||||
|
||||
def _handle_error(error_msg, from_setup):
|
||||
|
@ -150,7 +150,7 @@ describe('SearchObjects', ()=>{
|
||||
};
|
||||
|
||||
it('search', (done)=>{
|
||||
let ctrl = ctrlMount({});
|
||||
let ctrl = ctrlMount();
|
||||
setTimeout(()=>{
|
||||
ctrl.update();
|
||||
ctrl.find('InputText').find('input').simulate('change', {
|
||||
@ -166,7 +166,7 @@ describe('SearchObjects', ()=>{
|
||||
});
|
||||
|
||||
it('search_on_enter', (done)=>{
|
||||
let ctrl = ctrlMount({});
|
||||
let ctrl = ctrlMount();
|
||||
setTimeout(()=>{
|
||||
ctrl.update();
|
||||
ctrl.find('InputText').find('input').simulate('change', {
|
||||
@ -183,4 +183,4 @@ describe('SearchObjects', ()=>{
|
||||
}, 0);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -59,7 +59,7 @@ def dump_servers(args):
|
||||
print('----------')
|
||||
|
||||
app = create_app(config.APP_NAME + '-cli')
|
||||
with app.app_context():
|
||||
with app.test_request_context():
|
||||
dump_database_servers(args.dump_servers, args.servers, dump_user, True)
|
||||
|
||||
|
||||
@ -84,7 +84,7 @@ def load_servers(args):
|
||||
print('----------')
|
||||
|
||||
app = create_app(config.APP_NAME + '-cli')
|
||||
with app.app_context():
|
||||
with app.test_request_context():
|
||||
load_database_servers(args.load_servers, None, load_user, True)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user