diff --git a/src/rougail/update.py b/src/rougail/update.py index 8ec66f43..9214596e 100644 --- a/src/rougail/update.py +++ b/src/rougail/update.py @@ -139,7 +139,7 @@ class RougailUpgrade: for name in choices: choice = SubElement(variable, 'choice') choice.text = name - if not has_value: + if not has_value and choices[0]['type'] != 'variable': value = SubElement(variable, 'value') value.text = choices[0] variable.attrib['mandatory'] = 'True' @@ -235,7 +235,7 @@ class RougailUpgrade: function.append(param) else: choice = SubElement(target, 'choice') - if first_choice is None: + if first_choice is None and ('type' not in param.attrib or param.attrib['type'] != 'variable'): first_choice = choice choice.text = param.text if 'type' not in param.attrib and param.text is None: