From d7aeafdc6fffc38c9c52b05dd06748a6d3649478 Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Sat, 16 Apr 2022 16:14:32 +0200 Subject: [PATCH] [FIX]DBFilter from config : fix http_host when module not used --- dbfilter_from_config/__manifest__.py | 2 +- dbfilter_from_config/override.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dbfilter_from_config/__manifest__.py b/dbfilter_from_config/__manifest__.py index a84bddb..90f0b3c 100644 --- a/dbfilter_from_config/__manifest__.py +++ b/dbfilter_from_config/__manifest__.py @@ -27,7 +27,7 @@ Also required : `proxy_mode` to `True` Inspired from OCA `dbfilter_from_header`.""", - 'version': '12.0.0.0.2', + 'version': '12.0.0.0.3', 'category': 'Yaltik', 'author': 'Fabien Bourgeois', 'license': 'AGPL-3', diff --git a/dbfilter_from_config/override.py b/dbfilter_from_config/override.py index 5f746a4..6c05d72 100644 --- a/dbfilter_from_config/override.py +++ b/dbfilter_from_config/override.py @@ -38,10 +38,9 @@ http_host_resolv = {} def db_filter(dbs, httprequest=None): """ Override db_filter """ - print(http_host_resolv) + http_host = httprequest.environ.get('HTTP_HOST', '').split(':')[0] if db_filter_str: httprequest = httprequest or http.request.httprequest - http_host = httprequest.environ.get('HTTP_HOST', '').split(':')[0] # If in cache and not empty if http_host in http_host_resolv and http_host_resolv.get(http_host): dbs = http_host_resolv[http_host]