check with option as parameter
This commit is contained in:
@ -25,7 +25,8 @@ import warnings
|
||||
from tiramisu.i18n import _
|
||||
from tiramisu.setting import log, undefined
|
||||
from tiramisu.autolib import carry_out_calculation
|
||||
from tiramisu.error import ConfigError, ValueWarning, PropertiesOptionError
|
||||
from tiramisu.error import ConfigError, ValueWarning, PropertiesOptionError,\
|
||||
ContextError
|
||||
from tiramisu.storage import get_storages_option
|
||||
|
||||
|
||||
@ -77,8 +78,6 @@ def validate_callback(callback, callback_params, type_):
|
||||
'as length'))
|
||||
else:
|
||||
option, force_permissive = callbk
|
||||
if type_ == 'validator' and not force_permissive: # pragma: optional cover
|
||||
raise ValueError(_('validator not support tuple'))
|
||||
if not isinstance(option, Option) and not \
|
||||
isinstance(option, SymLinkOption): # pragma: optional cover
|
||||
raise ValueError(_('{0}_params must have an option'
|
||||
@ -531,9 +530,12 @@ class Option(OnlyOption):
|
||||
else:
|
||||
validator_params_ = {'': (val,)}
|
||||
# Raise ValueError if not valid
|
||||
carry_out_calculation(self, context=context,
|
||||
callback=validator,
|
||||
callback_params=validator_params_)
|
||||
try:
|
||||
carry_out_calculation(self, context=context,
|
||||
callback=validator,
|
||||
callback_params=validator_params_)
|
||||
except ContextError:
|
||||
pass
|
||||
|
||||
def do_validation(_value, _index, submulti_index):
|
||||
if _value is None:
|
||||
|
Reference in New Issue
Block a user