From 1dfa3946b554ed27b77af357e140739bd9e06eae Mon Sep 17 00:00:00 2001 From: Augustin Cisterne-Kaas Date: Thu, 5 Jun 2014 16:09:04 +0200 Subject: [PATCH] [IMP] Db filter %h Db filter %h skips www subdomain. --- openerp/http.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openerp/http.py b/openerp/http.py index abee8ac2b3d..98a6556570a 100644 --- a/openerp/http.py +++ b/openerp/http.py @@ -1287,7 +1287,9 @@ def db_list(force=False, httprequest=None): def db_filter(dbs, httprequest=None): httprequest = httprequest or request.httprequest h = httprequest.environ.get('HTTP_HOST', '').split(':')[0] - d = h.split('.')[0] + d, _, r = h.partition('.') + if d == "www" and r: + d = r.partition('.')[0] r = openerp.tools.config['dbfilter'].replace('%h', h).replace('%d', d) dbs = [i for i in dbs if re.match(r, i)] return dbs