Skip to content

Commit 1eb6376

Browse files
author
Alessandro Pasotti
committed
[dbmanager] Use user name as DB name if provided
Followup for 212b125
1 parent f227174 commit 1eb6376

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/plugins/db_manager/db_plugins/postgis/connector.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ def __init__(self, uri):
5353

5454
# Do not get db and user names from the env if service is used
5555
if uri.service() is None:
56-
self.dbname = uri.database() or os.environ.get('PGDATABASE') or username
57-
uri.setDatabase(self.dbname)
5856
if username is None:
5957
username = os.environ.get('USER')
58+
self.dbname = uri.database() or os.environ.get('PGDATABASE') or username
59+
uri.setDatabase(self.dbname)
6060

6161
expandedConnInfo = self._connectionInfo()
6262
try:

0 commit comments

Comments
 (0)