From e19401bd25aea38033293477d13d2b6095d3900b Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Sat, 16 Apr 2022 16:18:40 +0200 Subject: [PATCH] [FIX]DBFilter from config : when httprequest is none --- dbfilter_from_config/__manifest__.py | 2 +- dbfilter_from_config/override.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dbfilter_from_config/__manifest__.py b/dbfilter_from_config/__manifest__.py index 447d63d..6b22dcf 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': '15.0.0.0.3', + 'version': '15.0.0.0.4', 'category': 'Yaltik', 'author': 'Fabien Bourgeois', 'license': 'AGPL-3', diff --git a/dbfilter_from_config/override.py b/dbfilter_from_config/override.py index 6c05d72..b48dab3 100644 --- a/dbfilter_from_config/override.py +++ b/dbfilter_from_config/override.py @@ -38,7 +38,7 @@ http_host_resolv = {} def db_filter(dbs, httprequest=None): """ Override db_filter """ - http_host = httprequest.environ.get('HTTP_HOST', '').split(':')[0] + http_host = httprequest.environ.get('HTTP_HOST', '').split(':')[0] if httprequest else '' if db_filter_str: httprequest = httprequest or http.request.httprequest # If in cache and not empty