Use the shared server username when opening query tool. #5533

This commit is contained in:
Aditya Toshniwal
2022-11-16 13:40:38 +05:30
committed by GitHub
parent 2a7b5a572f
commit 6d881fa34e

View File

@@ -304,6 +304,12 @@ def panel(trans_id):
params['fgcolor'] = None params['fgcolor'] = None
s = Server.query.filter_by(id=params['sid']).first() s = Server.query.filter_by(id=params['sid']).first()
if s.shared and s.user_id != current_user.id:
# Import here to avoid circular dependency
from pgadmin.browser.server_groups.servers import ServerModule
shared_server = ServerModule.get_shared_server(s, params['sgid'])
s = ServerModule.get_shared_server_properties(s, shared_server)
if s and s.bgcolor: if s and s.bgcolor:
# If background is set to white means we do not have to change # If background is set to white means we do not have to change
# the title background else change it as per user specified # the title background else change it as per user specified