Skip to content
Permalink
Browse files

[db_manager] Fix connection to postgis

  • Loading branch information
arnaud-morvan committed Nov 6, 2016
1 parent 8b8bc26 commit 9cd39e79dd6bac0b79d3f2da9217777f60c70d66
@@ -64,7 +64,7 @@ def __init__(self, uri):

expandedConnInfo = self._connectionInfo()
try:
self.connection = psycopg2.connect(expandedConnInfo.encode('utf-8'))
self.connection = psycopg2.connect(expandedConnInfo)
except self.connection_error_types() as e:
err = str(e)
uri = self.uri()
@@ -83,7 +83,7 @@ def __init__(self, uri):

newExpandedConnInfo = uri.connectionInfo(True)
try:
self.connection = psycopg2.connect(newExpandedConnInfo.encode('utf-8'))
self.connection = psycopg2.connect(newExpandedConnInfo)
QgsCredentials.instance().put(conninfo, username, password)
except self.connection_error_types() as e:
if i == 2:
@@ -88,6 +88,9 @@ def connect(self, parent=None):

settings.endGroup()

if hasattr(authcfg, 'isNull') and authcfg.isNull():
authcfg = ''

if service:
uri.setConnection(service, database, username, password, sslmode, authcfg)
else:

0 comments on commit 9cd39e7

Please sign in to comment.
You can’t perform that action at this time.