Skip to content

Commit

Permalink
Set dbname from environment, if not set already
Browse files Browse the repository at this point in the history
  • Loading branch information
strk committed Jan 9, 2020
1 parent 67ce48f commit 07d88b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/plugins/db_manager/db_plugins/postgis/connector.py
Expand Up @@ -166,12 +166,12 @@ def __init__(self, uri):
:param uri: data source URI
:type uri: QgsDataSourceUri
:param dbplugin: the PostGisDBPlugin parent instance
:type dbplugin: PostGisDbPlugin
"""
DBConnector.__init__(self, uri)

self.dbname = uri.database()
username = uri.username() or os.environ.get('PGUSER')
self.dbname = uri.database() or os.environ.get('PGDATABASE') or username
uri.setDatabase(self.dbname)

#self.connName = connName
#self.user = uri.username() or os.environ.get('USER')
Expand Down

0 comments on commit 07d88b1

Please sign in to comment.