[FIX]DBFilter from config : when httprequest is none

This commit is contained in:
Fabien BOURGEOIS 2022-04-16 16:18:40 +02:00
parent d7aeafdc6f
commit 401b3b5ffc
2 changed files with 2 additions and 2 deletions

View File

@ -27,7 +27,7 @@
Also required : `proxy_mode` to `True`
Inspired from OCA `dbfilter_from_header`.""",
'version': '12.0.0.0.3',
'version': '12.0.0.0.4',
'category': 'Yaltik',
'author': 'Fabien Bourgeois',
'license': 'AGPL-3',

View File

@ -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