mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
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:
parent
80314a9aa3
commit
3323543b5a
@ -460,13 +460,13 @@ WHERE db.oid = {0}""".format(did))
|
|||||||
|
|
||||||
if status and len(res['rows']) > 0:
|
if status and len(res['rows']) > 0:
|
||||||
for row in res['rows']:
|
for row in res['rows']:
|
||||||
db_info[did] = row
|
self.db_info[did] = row
|
||||||
database = db_info[did]['datname']
|
database = self.db_info[did]['datname']
|
||||||
|
|
||||||
if did not in db_info:
|
if did not in self.db_info:
|
||||||
return False, gettext(
|
raise Exception(gettext(
|
||||||
"Coudn't find the database!"
|
"Coudn't find the database!"
|
||||||
)
|
))
|
||||||
|
|
||||||
if database is None:
|
if database is None:
|
||||||
raise Exception(msg_active_conn)
|
raise Exception(msg_active_conn)
|
||||||
|
Loading…
Reference in New Issue
Block a user