From 402c9fa20b9b25efdac4e3a1e4eac9d86f45467a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 6 Jul 2026 09:07:08 +0200 Subject: [PATCH] Permit __url__ and __href__ attribute usage in Genshi evaluation Closes #14932 (grafted from 936431c951bb4eb9d17c399445c6cacf7dcb8626) --HG-- branch : 8.0 --- trytond/trytond/_safe_genshi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/trytond/trytond/_safe_genshi.py b/trytond/trytond/_safe_genshi.py index 8db061e32b..1278f49d63 100644 --- a/trytond/trytond/_safe_genshi.py +++ b/trytond/trytond/_safe_genshi.py @@ -10,7 +10,8 @@ class _SafeASTTransformer(ASTTransformer): def visit_Attribute(self, node): if (node.attr.startswith('_') - and node.attr not in {'__class__', '__name__'}): + and node.attr not in { + '__class__', '__name__', '__url__', '__href__'}): raise ValueError(f"invalid attribute {node.attr!r}") return super().visit_Attribute(node)