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

@ -11,6 +11,7 @@ New features
| `Issue #6543 <https://redmine.postgresql.org/issues/6543>`_ - Added support for Two-factor authentication for improving security.
| `Issue #6872 <https://redmine.postgresql.org/issues/6872>`_ - Include GSSAPI support in the PostgreSQL libraries and utilities on macOS.
| `Issue #7039 <https://redmine.postgresql.org/issues/7039>`_ - Added support to disable the auto-discovery of the database servers.
Housekeeping
************

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