Fix connection restoration issue when pgAdmin server is restarted and the page is refreshed. Fixes #4357

This commit is contained in:
Aditya Toshniwal 2019-06-14 11:50:01 +05:30 committed by Akshay Joshi
parent 04328b76ba
commit 82bd94e696
2 changed files with 7 additions and 5 deletions

View File

@ -27,3 +27,4 @@ Bug fixes
| `Bug #4329 <https://redmine.postgresql.org/issues/4329>`_ - Fix an initialisation error when two functions with parameters are debugged in parallel.
| `Bug #4343 <https://redmine.postgresql.org/issues/4343>`_ - Fix issue where property dialog of column should open properly for EPAS v12.
| `Bug #4350 <https://redmine.postgresql.org/issues/4350>`_ - Ensure we include the CSRF token when uploading files.
| `Bug #4357 <https://redmine.postgresql.org/issues/4357>`_ - Fix connection restoration issue when pgAdmin server is restarted and the page is refreshed.

View File

@ -84,9 +84,10 @@ class Driver(BaseDriver):
if '__pgsql_server_managers' in session:
session_managers = session['__pgsql_server_managers'].copy()
manager = managers[str(sid)] = ServerManager(server_data)
if sid in session_managers:
manager._restore(session_managers[sid])
for server in Server.query.filter_by(user_id=current_user.id):
manager = managers[str(server.id)] = ServerManager(server)
if server.id in session_managers:
manager._restore(session_managers[server.id])
manager.update_session()
else:
managers = self.managers[session.sid]