Skip to content

Commit

Permalink
[processing] Fix connection to postgis
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud-morvan committed Nov 6, 2016
1 parent e426dbc commit 8b8bc26
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/plugins/processing/tools/postgis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -202,7 +205,7 @@ def __init__(self, host=None, port=None, dbname=None, user=None,
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(),
Expand Down

0 comments on commit 8b8bc26

Please sign in to comment.