Skip to content

Commit 714196e

Browse files
[FIX] auth_jwt: mute noisy Odoo test patch checker
See odoo/odoo#247151
1 parent 46f87ca commit 714196e

1 file changed

Lines changed: 15 additions & 13 deletions

File tree

auth_jwt/models/auth_jwt_validator.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
from odoo import _, api, fields, models, tools
1515
from odoo.exceptions import ValidationError
16+
from odoo.tools import mute_logger
1617

1718
from ..exceptions import (
1819
AmbiguousJwtValidator,
@@ -251,19 +252,20 @@ def _register_hook(self):
251252

252253
def _register_auth_method(self):
253254
IrHttp = self.env["ir.http"]
254-
for rec in self:
255-
setattr(
256-
IrHttp.__class__,
257-
f"_auth_method_jwt_{rec.name}",
258-
partial(IrHttp.__class__._auth_method_jwt, validator_name=rec.name),
259-
)
260-
setattr(
261-
IrHttp.__class__,
262-
f"_auth_method_public_or_jwt_{rec.name}",
263-
partial(
264-
IrHttp.__class__._auth_method_public_or_jwt, validator_name=rec.name
265-
),
266-
)
255+
with mute_logger("odoo.tests.common"): # Mute patch checker during tests
256+
for rec in self:
257+
setattr(
258+
IrHttp.__class__,
259+
f"_auth_method_jwt_{rec.name}",
260+
partial(IrHttp.__class__._auth_method_jwt, validator_name=rec.name),
261+
)
262+
setattr(
263+
IrHttp.__class__,
264+
f"_auth_method_public_or_jwt_{rec.name}",
265+
partial(
266+
IrHttp.__class__._auth_method_public_or_jwt, validator_name=rec.name
267+
),
268+
)
267269

268270
def _unregister_auth_method(self):
269271
IrHttp = self.env["ir.http"]

0 commit comments

Comments
 (0)