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

pull/5540/head
Aditya Toshniwal 2022-11-16 13:40:38 +05:30 committed by GitHub
parent 2a7b5a572f
commit 6d881fa34e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -304,6 +304,12 @@ def panel(trans_id):
params['fgcolor'] = None
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 background is set to white means we do not have to change
# the title background else change it as per user specified