From 36e113e6bd215e56e8bea2157db4f90b838cb750 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 11 Jun 2013 13:03:27 +0200 Subject: [PATCH] [FIX] web: handle monodb correctly when server started with "--no-database-list" option bzr revid: chs@openerp.com-20130611110327-sipc2er6z1ch7leb --- addons/web/controllers/main.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index d0bdfe3cdc4..66db8aa6974 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -84,9 +84,9 @@ def rjsmin(script): ).strip() return result -def db_list(req): +def db_list(req, force=False): proxy = req.session.proxy("db") - dbs = proxy.list() + dbs = proxy.list(force) h = req.httprequest.environ['HTTP_HOST'].split(':')[0] d = h.split('.')[0] r = openerp.tools.config['dbfilter'].replace('%h', h).replace('%d', d) @@ -103,7 +103,7 @@ def db_monodb_redirect(req): return (db_url, False) try: - dbs = db_list(req) + dbs = db_list(req, True) except xmlrpclib.Fault: # ignore access denied dbs = [] @@ -757,6 +757,10 @@ class Database(openerpweb.Controller): @openerpweb.jsonrequest def get_list(self, req): + # TODO change js to avoid calling this method if in monodb mode + monodb = db_monodb(req) + if monodb: + return [monodb] return db_list(req) @openerpweb.jsonrequest