support empty param

This commit is contained in:
Emmanuel Garette 2020-10-04 20:11:00 +02:00
parent 3040a11de9
commit 43e30bba47
4 changed files with 12 additions and 3 deletions

View file

@ -1037,6 +1037,9 @@ class ConstraintAnnotator:
raise DictConsistencyError(_(f"All '{param.type}' variables must have a value in order to calculate {fill.target}"))
if param.type == 'suffix' and hasattr(param, 'text'):
raise DictConsistencyError(_(f"All '{param.type}' variables must not have a value in order to calculate {fill.target}"))
if param.type == 'string':
if not hasattr(param, 'text'):
param.text = None
if param.type == 'variable':
try:
param.text, suffix = self.objectspace.paths.get_variable_path(param.text,

View file

@ -12,7 +12,9 @@
<constraints>
<check name="valid_enum" target="mode_conteneur_actif">
<param>['a','b','c']</param>
<param>a</param>
<param>b</param>
<param>c</param>
</check>
</constraints>

View file

@ -17,7 +17,9 @@
<constraints>
<check name="valid_enum" target="enumvar">
<param>['a', 'b', 'c']</param>
<param>a</param>
<param>b</param>
<param>c</param>
</check>
</constraints>

View file

@ -19,7 +19,9 @@
<constraints>
<check name="valid_enum" target="enumvar">
<param>[1, 2, 3]</param>
<param>1</param>
<param>2</param>
<param>3</param>
</check>
</constraints>