calculation with submulti

This commit is contained in:
Emmanuel Garette 2021-03-18 08:57:22 +01:00
parent b76db42204
commit af2d3eb3ce
1 changed files with 15 additions and 5 deletions

View File

@ -69,7 +69,17 @@ class Leadership(OptionDescription):
child.impl_get_display_name())) child.impl_get_display_name()))
if idx != 0: if idx != 0:
default = child.impl_getdefault() default = child.impl_getdefault()
if default != [] and not isinstance(default, Calculation): if default != []:
if child.impl_is_submulti() and isinstance(default, tuple):
for val in default:
if not isinstance(val, Calculation):
calculation = False
else:
# empty default is valid
calculation = True
else:
calculation = isinstance(default, Calculation)
if not calculation:
raise ValueError(_('not allowed default value for follower option "{0}" ' raise ValueError(_('not allowed default value for follower option "{0}" '
'in leadership "{1}"' 'in leadership "{1}"'
'').format(child.impl_get_display_name(), '').format(child.impl_get_display_name(),