Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Do not get db and user names from the env if service is used
  • Loading branch information
strk committed Jan 9, 2020
1 parent 07d88b1 commit d2d723b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions python/plugins/db_manager/db_plugins/postgis/connector.py
Expand Up @@ -170,8 +170,13 @@ def __init__(self, uri):
DBConnector.__init__(self, uri)

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

# Do not get db and user names from the env if service is used
if not uri.service():
if username is None:
username = os.environ.get('USER')
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 d2d723b

Please sign in to comment.