From 56d0a610ffe408a7238f199303eb538f93de6c91 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Wed, 24 Nov 2021 19:15:38 +0100 Subject: [PATCH] upgrade --- src/rougail/update.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rougail/update.py b/src/rougail/update.py index 8ec66f43f..9214596e1 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: