|
@ -19,8 +19,10 @@ |
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
|
# |
|
|
# |
|
|
############################################################################## |
|
|
############################################################################## |
|
|
|
|
|
import logging |
|
|
import re |
|
|
import re |
|
|
from openerp import http |
|
|
from openerp import http |
|
|
|
|
|
from openerp.tools import config |
|
|
|
|
|
|
|
|
db_filter_org = http.db_filter |
|
|
db_filter_org = http.db_filter |
|
|
|
|
|
|
|
@ -38,4 +40,8 @@ def db_filter(dbs, httprequest=None): |
|
|
dbs = [db for db in dbs if re.match(db_filter_hdr, db)] |
|
|
dbs = [db for db in dbs if re.match(db_filter_hdr, db)] |
|
|
return dbs |
|
|
return dbs |
|
|
|
|
|
|
|
|
|
|
|
if config.get('proxy_mode') and \ |
|
|
|
|
|
'dbfilter_from_header' in config.get('server_wide_modules'): |
|
|
|
|
|
_logger = logging.getLogger(__name__) |
|
|
|
|
|
_logger.info('monkey patching http.db_filter') |
|
|
http.db_filter = db_filter |
|
|
http.db_filter = db_filter |