Fix an issue where importing servers fails if a group already exists for a different user. Fixes #4022

This commit is contained in:
Dave Page 2019-02-21 15:40:37 +00:00
parent 98283c1213
commit 73b144c45c
2 changed files with 5 additions and 4 deletions

View File

@ -35,4 +35,5 @@ Bug fixes
| `Bug #3974 <https://redmine.postgresql.org/issues/3974>`_ - Fix alignment of Connection type toggle switch of pgagent.
| `Bug #3981 <https://redmine.postgresql.org/issues/3981>`_ - Fix the query to set bytea_output so that read-only standbys don't consider it a write query.
| `Bug #3985 <https://redmine.postgresql.org/issues/3985>`_ - Don't embed docs and external sites in iframes, to allow the external sites to set X-FRAME-OPTIONS = DENY for security.
| `Bug #4021 <https://redmine.postgresql.org/issues/4021>`_ - Disable the editor and execute functions whilst queries are executing.
| `Bug #4021 <https://redmine.postgresql.org/issues/4021>`_ - Disable the editor and execute functions whilst queries are executing.
| `Bug #4022 <https://redmine.postgresql.org/issues/4022>`_ - Fix an issue where importing servers fails if a group already exists for a different user.

View File

@ -190,8 +190,8 @@ def load_servers(args):
groups_added = 0
servers_added = 0
# Get the server group
groups = ServerGroup.query.all()
# Get the server groups
groups = ServerGroup.query.filter_by(user_id=user_id)
def print_summary():
print("Added %d Server Group(s) and %d Server(s)." %
@ -251,7 +251,7 @@ def load_servers(args):
group_id = new_group.id
groups_added = groups_added + 1
groups = ServerGroup.query.all()
groups = ServerGroup.query.filter_by(user_id=user_id)
# Create the server
new_server = Server()