mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-16 00:03:12 -04:00
[processing] Fix connection to postgis
This commit is contained in:
parent
e426dbc86b
commit
8b8bc26ee0
@ -59,6 +59,9 @@ def uri_from_name(conn_name):
|
|||||||
|
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
|
|
||||||
|
if hasattr(authcfg, 'isNull') and authcfg.isNull():
|
||||||
|
authcfg = ''
|
||||||
|
|
||||||
if service:
|
if service:
|
||||||
uri.setConnection(service, database, username, password, sslmode, authcfg)
|
uri.setConnection(service, database, username, password, sslmode, authcfg)
|
||||||
else:
|
else:
|
||||||
@ -202,7 +205,7 @@ class GeoDB(object):
|
|||||||
for i in range(4):
|
for i in range(4):
|
||||||
expandedConnInfo = self.uri.connectionInfo(True)
|
expandedConnInfo = self.uri.connectionInfo(True)
|
||||||
try:
|
try:
|
||||||
self.con = psycopg2.connect(expandedConnInfo.encode('utf-8'))
|
self.con = psycopg2.connect(expandedConnInfo)
|
||||||
if err is not None:
|
if err is not None:
|
||||||
QgsCredentials.instance().put(conninfo,
|
QgsCredentials.instance().put(conninfo,
|
||||||
self.uri.username(),
|
self.uri.username(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user