From 15701010886aac41862487029b5ba790bfd84cd7 Mon Sep 17 00:00:00 2001 From: gwen Date: Tue, 6 Aug 2024 10:48:14 +0200 Subject: [PATCH] optional sub attribute unauthorized --- src/rougail/tiramisureflector.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/rougail/tiramisureflector.py b/src/rougail/tiramisureflector.py index 571207616..ee493abf2 100644 --- a/src/rougail/tiramisureflector.py +++ b/src/rougail/tiramisureflector.py @@ -478,9 +478,13 @@ class Variable(Common): keys["default"] = self.populate_calculation(self.elt.default) except VariableCalculationDependencyError: pass - for attribute in ['frozen', 'hidden', "mandatory", "disabled"]: - if hasattr(self.elt, attribute): - raise DictConsistencyError(f"Sub-attributes not allowed in a '{attribute}' attribute", 100, self.elt.xmlfiles) + for attribute in ["frozen", "hidden", "mandatory", "disabled"]: + if hasattr(self.elt, attribute): # FIXME FIXME and attribute == "optional": + raise DictConsistencyError( + f"Sub-attributes not allowed in a '{attribute}' attribute", + 100, + self.elt.xmlfiles, + ) if self.elt.path in self.objectspace.default_multi: try: keys["default_multi"] = self.populate_calculation(