[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
This commit is contained in:
Olivier Dony 2013-03-18 15:15:32 +01:00
parent 5cdc6aa4a1
commit 8d6e91219f
1 changed files with 1 additions and 1 deletions

View File

@ -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']