Initial support for PG 10.0, per #2214

This commit is contained in:
Akshay Joshi
2017-04-24 13:55:29 +01:00
committed by Dave Page
parent 3eb92f7ea3
commit 59834fba31
8 changed files with 22 additions and 42 deletions

View File

@@ -131,6 +131,22 @@ def check_precondition(f):
PG_DEFAULT_DRIVER).connection_manager(
kwargs['sid']
)
# Below check handle the case where existing server is deleted
# by user and python server will raise exception if this check
# is not introduce.
if g.manager is None:
if f.__name__ in ['activity', 'prepared', 'locks', 'config']:
return precondition_required(
gettext("Please connect to the selected server"
" to view the table.")
)
else:
return precondition_required(
gettext("Please connect to the selected server"
" to view the graph.")
)
g.conn = g.manager.connection()
# If DB not connected then return error to browser