From c48d376d49301cbb197bf13f9e95431aa98b234d Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Mon, 7 Sep 2026 10:33:58 +0200 Subject: [PATCH] fix: in user_data if dynamic is not already exists, do not raises --- src/rougail/convert/collect.py | 2 +- src/rougail/user_data.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/rougail/convert/collect.py b/src/rougail/convert/collect.py index 8f7f9f654..7434360e8 100644 --- a/src/rougail/convert/collect.py +++ b/src/rougail/convert/collect.py @@ -307,7 +307,7 @@ class CollectType: if not self.object: self.set_object_user_type_variable() if self.raises and not self.object: - msg = _('cannot determine the type of the {0} "{1}"').format( + msg = _('the type "{0}" for "{1}" is unknown').format( self.user_type, self.path ) raise DictConsistencyError(msg, 43, self.sources) diff --git a/src/rougail/user_data.py b/src/rougail/user_data.py index f8b170bac..e7f73455c 100644 --- a/src/rougail/user_data.py +++ b/src/rougail/user_data.py @@ -185,7 +185,11 @@ class UserData: ) # do not add values in variable if has already a value if dynamic_variable not in self.values and not dyn_options_values: - self.values[dynamic_variable] = [{"values": option.value.get()}] + try: + values = self.config.option(dynamic_variable).value.get() + except AttributeOptionError: + values = [] + self.values[dynamic_variable] = [{"values": values}] added.append(dynamic_variable) elif dynamic_variable not in added: continue