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

@ -26,4 +26,5 @@ Bug fixes
| `Bug #4320 <https://redmine.postgresql.org/issues/4320>`_ - Fix issue where SSH tunnel connection using password is failing, it's regression of Master Password. | `Bug #4320 <https://redmine.postgresql.org/issues/4320>`_ - Fix issue where SSH tunnel connection using password is failing, it's regression of Master Password.
| `Bug #4329 <https://redmine.postgresql.org/issues/4329>`_ - Fix an initialisation error when two functions with parameters are debugged in parallel. | `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 #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 #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,10 +84,11 @@ class Driver(BaseDriver):
if '__pgsql_server_managers' in session: if '__pgsql_server_managers' in session:
session_managers = session['__pgsql_server_managers'].copy() session_managers = session['__pgsql_server_managers'].copy()
manager = managers[str(sid)] = ServerManager(server_data) for server in Server.query.filter_by(user_id=current_user.id):
if sid in session_managers: manager = managers[str(server.id)] = ServerManager(server)
manager._restore(session_managers[sid]) if server.id in session_managers:
manager.update_session() manager._restore(session_managers[server.id])
manager.update_session()
else: else:
managers = self.managers[session.sid] managers = self.managers[session.sid]
if str(sid) in managers: if str(sid) in managers: