calculation with submulti
This commit is contained in:
parent
668ed3ad37
commit
29282d8ea3
|
@ -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(),
|
||||||
|
|
Loading…
Reference in New Issue