remove_choice only avalable for choice
This commit is contained in:
@ -393,7 +393,7 @@ class RougailObjSpace:
|
||||
for attr, val in child.attrib.items():
|
||||
if redefine and attr in UNREDEFINABLE:
|
||||
msg = _(f'cannot redefine attribute "{attr}" for variable "{child.attrib["name"]}"'
|
||||
f' in "{xmlfile}", already defined')
|
||||
f' already defined')
|
||||
raise DictConsistencyError(msg, 48, variableobj.xmlfiles[:-1])
|
||||
if attr in self.booleans_attributs:
|
||||
val = convert_boolean(val)
|
||||
@ -411,6 +411,10 @@ class RougailObjSpace:
|
||||
"""
|
||||
if child.tag == 'variable':
|
||||
if child.attrib.get('remove_choice', False):
|
||||
if variableobj.type != 'choice':
|
||||
msg = _(f'cannot remove choices for variable "{variableobj.path}"'
|
||||
f' the variable has type "{variableobj.type}"')
|
||||
raise DictConsistencyError(msg, 33, variableobj.xmlfiles)
|
||||
variableobj.choice = []
|
||||
if child.attrib.get('remove_check', False):
|
||||
self.remove_check(variableobj.name)
|
||||
|
Reference in New Issue
Block a user