Fix an issue where the default server-group is being deleted if the load-server json file contains no servers. #6602

This commit is contained in:
Benjamin Blattberg
2023-10-23 00:46:57 -05:00
committed by GitHub
parent fe753bd272
commit e587ef404c
2 changed files with 12 additions and 7 deletions

View File

@@ -182,6 +182,10 @@ class ServerGroupView(NodeView):
).order_by("id")
# if server group id is 1 we won't delete it.
# This matches the behavior of
# web/pgadmin/utils/__init.py__#clear_database_servers
# called by the setup script when importing and replacing servers:
# `python setup.py --load-servers input_file.json --replace`
sg = groups.first()
shared_servers = Server.query.filter_by(servergroup_id=gid,