[MIG] dbfilter_from_header: Migration to 16.0

Signed-off-by: Carmen Bianca Bakker <carmen@coopiteasy.be>
pull/2425/head
Carmen Bianca Bakker 2022-10-13 16:17:20 +02:00 committed by Carmen Bianca BAKKER
parent a6fee2bdaa
commit e6cec5324e
No known key found for this signature in database
GPG Key ID: 76EBA6F6B6EA2EC9
2 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@
{ {
"name": "dbfilter_from_header", "name": "dbfilter_from_header",
"summary": "Filter databases with HTTP headers", "summary": "Filter databases with HTTP headers",
"version": "15.0.1.0.0", "version": "16.0.1.0.0",
"website": "https://github.com/OCA/server-tools", "website": "https://github.com/OCA/server-tools",
"author": "Therp BV, Odoo Community Association (OCA)", "author": "Therp BV, Odoo Community Association (OCA)",
"license": "AGPL-3", "license": "AGPL-3",

View File

@ -12,9 +12,9 @@ from odoo.tools import config
db_filter_org = http.db_filter db_filter_org = http.db_filter
def db_filter(dbs, httprequest=None): def db_filter(dbs, host=None):
dbs = db_filter_org(dbs, httprequest) dbs = db_filter_org(dbs, host)
httprequest = httprequest or http.request.httprequest httprequest = http.request.httprequest
db_filter_hdr = httprequest.environ.get("HTTP_X_ODOO_DBFILTER") db_filter_hdr = httprequest.environ.get("HTTP_X_ODOO_DBFILTER")
if db_filter_hdr: if db_filter_hdr:
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)]