[FIX]DBFilter from config : when httprequest is none
This commit is contained in:
parent
d7aeafdc6f
commit
401b3b5ffc
@ -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',
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user