[processing] Fix connection to postgis

This commit is contained in:
arnaud.morvan@camptocamp.com 2016-10-19 10:25:04 +02:00
parent e426dbc86b
commit 8b8bc26ee0

View File

@ -59,6 +59,9 @@ def uri_from_name(conn_name):
settings.endGroup()
if hasattr(authcfg, 'isNull') and authcfg.isNull():
authcfg = ''
if service:
uri.setConnection(service, database, username, password, sslmode, authcfg)
else:
@ -202,7 +205,7 @@ class GeoDB(object):
for i in range(4):
expandedConnInfo = self.uri.connectionInfo(True)
try:
self.con = psycopg2.connect(expandedConnInfo.encode('utf-8'))
self.con = psycopg2.connect(expandedConnInfo)
if err is not None:
QgsCredentials.instance().put(conninfo,
self.uri.username(),