[MIG] dbfilter_from_header: Migration to 16.0
Signed-off-by: Carmen Bianca Bakker <carmen@coopiteasy.be>pull/2425/head
parent
a6fee2bdaa
commit
e6cec5324e
|
@ -6,7 +6,7 @@
|
|||
{
|
||||
"name": "dbfilter_from_header",
|
||||
"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",
|
||||
"author": "Therp BV, Odoo Community Association (OCA)",
|
||||
"license": "AGPL-3",
|
||||
|
|
|
@ -12,9 +12,9 @@ from odoo.tools import config
|
|||
db_filter_org = http.db_filter
|
||||
|
||||
|
||||
def db_filter(dbs, httprequest=None):
|
||||
dbs = db_filter_org(dbs, httprequest)
|
||||
httprequest = httprequest or http.request.httprequest
|
||||
def db_filter(dbs, host=None):
|
||||
dbs = db_filter_org(dbs, host)
|
||||
httprequest = http.request.httprequest
|
||||
db_filter_hdr = httprequest.environ.get("HTTP_X_ODOO_DBFILTER")
|
||||
if db_filter_hdr:
|
||||
dbs = [db for db in dbs if re.match(db_filter_hdr, db)]
|
||||
|
|
Loading…
Reference in New Issue