details: https://code.tryton.org/tryton/commit/cced2de20ea4
branch: 7.0
user: Cédric Krier <[email protected]>
date: Mon Jul 06 09:07:08 2026 +0200
description:
Permit __url__ and __href__ attribute usage in Genshi evaluation
Closes #14932
(grafted from 936431c951bb4eb9d17c399445c6cacf7dcb8626)
diffstat:
trytond/trytond/_safe_genshi.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diffs (13 lines):
diff -r 156f0d73fce3 -r cced2de20ea4 trytond/trytond/_safe_genshi.py
--- a/trytond/trytond/_safe_genshi.py Thu Jul 02 16:38:57 2026 +0200
+++ b/trytond/trytond/_safe_genshi.py Mon Jul 06 09:07:08 2026 +0200
@@ -10,7 +10,8 @@
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)