Ensure "dbname" is set in the uri, once again

Fixes #16625 (ref #10600)
This commit is contained in:
Sandro Santilli 2017-05-26 15:10:57 +02:00
parent c05d779ccd
commit 13e39da074

View File

@ -56,7 +56,7 @@ class PostGisDBConnector(DBConnector):
password = uri.password() or os.environ.get('PGPASSWORD')
# Do not get db and user names from the env if service is used
if uri.service() is None:
if not uri.service():
if username is None:
username = os.environ.get('USER')
self.dbname = uri.database() or os.environ.get('PGDATABASE') or username