This commit is contained in:
Emmanuel Garette 2018-04-16 21:07:20 +02:00
parent 8b82e393fe
commit 0b66c96f5e
1 changed files with 12 additions and 14 deletions

View File

@ -203,20 +203,18 @@ class Base(object):
calculator.__name__, calculator.__name__,
self.impl_get_display_name())) self.impl_get_display_name()))
has_index = False has_index = False
if is_multi and func_args: if is_multi and func_args and not self.impl_is_dynoptiondescription():
# there is extra args/kwargs if calculator_params is None:
if not self.impl_is_dynoptiondescription(): calculator_params = Params()
if calculator_params is None: params = list(calculator_params.args)
calculator_params = Params() if add_value:
params = list(calculator_params.args) # only for validator
if add_value: params.append(ParamOption(self))
# only for validator func_args.pop()
params.append(ParamOption(self)) if func_args:
func_args.pop() has_index = True
if func_args: params.append(ParamIndex())
has_index = True func_args.pop()
params.append(ParamIndex())
func_args.pop()
calculator_params.args = tuple(params) calculator_params.args = tuple(params)
if func_args: if func_args:
raise ConfigError(_('missing those arguments "{}" in function "{}" for "{}"' raise ConfigError(_('missing those arguments "{}" in function "{}" for "{}"'