diff --git a/trytond/backend/postgresql/database.py b/trytond/backend/postgresql/database.py index 2bbeca37af..16811f685d 100644 --- a/trytond/backend/postgresql/database.py +++ b/trytond/backend/postgresql/database.py @@ -192,7 +192,7 @@ class Database(DatabaseInterface): if res and abs(Database._list_cache_timestamp - now) < timeout: return res uri = parse_uri(config.get('database', 'uri')) - db_user = uri.username or os.environment.get('PGUSER') + db_user = uri.username or os.environ.get('PGUSER') if not db_user and os.name == 'posix': db_user = pwd.getpwuid(os.getuid())[0] if db_user: