better error when value not in a choice
This commit is contained in:
parent
5858bcc00b
commit
b76db42204
@ -20,6 +20,8 @@ from .i18n import _
|
||||
|
||||
|
||||
def display_list(lst, separator='and', add_quote=False):
|
||||
if not lst:
|
||||
return '""'
|
||||
if separator == 'and':
|
||||
separator = _('and')
|
||||
elif separator == 'or':
|
||||
|
@ -60,8 +60,8 @@ class ChoiceOption(Option):
|
||||
if isinstance(self._choice_values, Calculation):
|
||||
values = await self._choice_values.execute(option_bag)
|
||||
if values is not undefined and not isinstance(values, list):
|
||||
raise ConfigError(_('calculated values for {0} is not a list'
|
||||
'').format(self.impl_getname()))
|
||||
raise ConfigError(_('the calculated values "{0}" for "{1}" is not a list'
|
||||
'').format(values, self.impl_getname()))
|
||||
else:
|
||||
values = self._choice_values
|
||||
return values
|
||||
|
@ -84,7 +84,8 @@ class SynDynOptionDescription:
|
||||
|
||||
async def get_children(self,
|
||||
config_bag: ConfigBag,
|
||||
dyn: bool=True):
|
||||
dyn: bool=True,
|
||||
):
|
||||
subpath = self.impl_getpath()
|
||||
children = []
|
||||
for child in await self._opt.get_children(config_bag):
|
||||
|
Loading…
Reference in New Issue
Block a user