From 97c0d6a0e57340fdbd7667d67ff5276e20c6c0f2 Mon Sep 17 00:00:00 2001 From: Goffi Date: Wed, 21 Sep 2022 22:43:55 +0200 Subject: [PATCH] tools (xml_tools): handle `required` field in `dataDict2dataForm`: rel 372 --- sat/tools/xml_tools.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sat/tools/xml_tools.py b/sat/tools/xml_tools.py index 69db3f5f..50ffd35f 100644 --- a/sat/tools/xml_tools.py +++ b/sat/tools/xml_tools.py @@ -259,6 +259,7 @@ def dataDict2dataForm(data_dict): - "xhtml" is used for "xml" fields with child in the C.NS_XHTML namespace - "options" are list of dict with optional "label" and mandatory "value" following suitable attributes from data_form.Option + - "required" is the same as data_form.Field.required """ # TODO: describe format fields = [] @@ -269,6 +270,7 @@ def dataDict2dataForm(data_dict): "var": field_data["name"], "label": field_data.get('label'), "value": field_data.get("value"), + "required": field_data.get("required") } if field_type == "xhtml": kwargs.update({