Resolved few issues in connection creation in the psycopg2 (pgAdmin

driver)

1. Update correct variable for database information in the connection
   manager.
2. Raise exception, when database not found, instead of return the
   (boolean, error message) tupple.
This commit is contained in:
Khushboo Vashi 2015-11-19 14:42:32 +05:30 committed by Ashesh Vashi
parent 80314a9aa3
commit 3323543b5a

View File

@ -460,13 +460,13 @@ WHERE db.oid = {0}""".format(did))
if status and len(res['rows']) > 0:
for row in res['rows']:
db_info[did] = row
database = db_info[did]['datname']
self.db_info[did] = row
database = self.db_info[did]['datname']
if did not in db_info:
return False, gettext(
if did not in self.db_info:
raise Exception(gettext(
"Coudn't find the database!"
)
))
if database is None:
raise Exception(msg_active_conn)