diff --git a/dbfilter_from_header/__init__.py b/dbfilter_from_header/__init__.py index b57de876a..3b8cc81fa 100644 --- a/dbfilter_from_header/__init__.py +++ b/dbfilter_from_header/__init__.py @@ -1,2 +1 @@ - from . import override diff --git a/dbfilter_from_header/__manifest__.py b/dbfilter_from_header/__manifest__.py index b9bd1e912..22b7f0ede 100644 --- a/dbfilter_from_header/__manifest__.py +++ b/dbfilter_from_header/__manifest__.py @@ -6,16 +6,13 @@ { "name": "dbfilter_from_header", "summary": "Filter databases with HTTP headers", - "version": "12.0.1.0.0", + "version": "13.0.1.0.0", "website": "https://github.com/OCA/server-tools", - "author": "Therp BV, " - "Odoo Community Association (OCA)", + "author": "Therp BV, " "Odoo Community Association (OCA)", "license": "AGPL-3", "complexity": "normal", "category": "Tools", - "depends": [ - 'web', - ], + "depends": ["web"], "auto_install": False, - 'installable': True, + "installable": True, } diff --git a/dbfilter_from_header/override.py b/dbfilter_from_header/override.py index 113acb6a0..b7cde207d 100644 --- a/dbfilter_from_header/override.py +++ b/dbfilter_from_header/override.py @@ -5,6 +5,7 @@ import logging import re + from odoo import http from odoo.tools import config @@ -14,14 +15,15 @@ db_filter_org = http.db_filter def db_filter(dbs, httprequest=None): dbs = db_filter_org(dbs, httprequest) httprequest = httprequest or 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: dbs = [db for db in dbs if re.match(db_filter_hdr, db)] return dbs -if config.get('proxy_mode') and \ - 'dbfilter_from_header' in config.get('server_wide_modules'): +if config.get("proxy_mode") and "dbfilter_from_header" in config.get( + "server_wide_modules" +): _logger = logging.getLogger(__name__) - _logger.info('monkey patching http.db_filter') + _logger.info("monkey patching http.db_filter") http.db_filter = db_filter