fix: in user_data if dynamic is not already exists, do not raises

This commit is contained in:
egarette@silique.fr 2026-09-07 10:33:58 +02:00
parent 4943dd0ccb
commit c48d376d49
2 changed files with 6 additions and 2 deletions

View file

@ -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)

View file

@ -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