fix: in user_data if dynamic is not already exists, do not raises
This commit is contained in:
parent
4943dd0ccb
commit
c48d376d49
2 changed files with 6 additions and 2 deletions
|
|
@ -307,7 +307,7 @@ class CollectType:
|
||||||
if not self.object:
|
if not self.object:
|
||||||
self.set_object_user_type_variable()
|
self.set_object_user_type_variable()
|
||||||
if self.raises and not self.object:
|
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
|
self.user_type, self.path
|
||||||
)
|
)
|
||||||
raise DictConsistencyError(msg, 43, self.sources)
|
raise DictConsistencyError(msg, 43, self.sources)
|
||||||
|
|
|
||||||
|
|
@ -185,7 +185,11 @@ class UserData:
|
||||||
)
|
)
|
||||||
# do not add values in variable if has already a value
|
# do not add values in variable if has already a value
|
||||||
if dynamic_variable not in self.values and not dyn_options_values:
|
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)
|
added.append(dynamic_variable)
|
||||||
elif dynamic_variable not in added:
|
elif dynamic_variable not in added:
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue