From 8d6e91219fa1eaab7616da10ae82c71fa9c71425 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Mon, 18 Mar 2013 15:15:32 +0100 Subject: [PATCH] [FIX] web_services: set PGPASSWORD in environment only when db_password is set in the config This prevents an error when trying to set an environment variable to `False`, and is the second part of the regression introduced in revision 4424. See previous partial fix at revision 4893 lp bug: https://launchpad.net/bugs/1155523 fixed bzr revid: odo@openerp.com-20130318141532-m2xsahh5u5pi5bth --- openerp/service/web_services.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/service/web_services.py b/openerp/service/web_services.py index 0aabe62b1d7..b45e4ce0eee 100644 --- a/openerp/service/web_services.py +++ b/openerp/service/web_services.py @@ -249,7 +249,7 @@ class db(netsvc.ExportService): SaaS (giving SaaS users the super-admin password is not a good idea anyway) """ - if os.environ.get('PGPASSWORD'): + if os.environ.get('PGPASSWORD') or not tools.config['db_password']: yield else: os.environ['PGPASSWORD'] = tools.config['db_password']