Added support to disable the auto-discovery of the database servers. Fixes #7039

This commit is contained in:
Akshay Joshi
2021-12-13 13:07:37 +05:30
parent fea44c07c7
commit da5545ff57
3 changed files with 15 additions and 0 deletions

View File

@@ -782,6 +782,14 @@ ENABLE_PSQL = False
##########################################################################
ENABLE_BINARY_PATH_BROWSING = False
#############################################################################
# AUTO_DISCOVER_SERVERS setting is used to enable the pgAdmin to discover the
# database server automatically on the local machine.
# When it is set to False, pgAdmin will not discover servers installed on
# the local machine.
#############################################################################
AUTO_DISCOVER_SERVERS = True
##########################################################################
# Local config settings
##########################################################################

View File

@@ -537,6 +537,12 @@ def create_app(app_name=None):
##########################################################################
@user_logged_in.connect_via(app)
def on_user_logged_in(sender, user):
# If Auto Discover servers is turned off then return from the
# function.
if not config.AUTO_DISCOVER_SERVERS:
return
# Keep hold of the user ID
user_id = user.id