From 9f35dca96fb34f50b93aeb022524933b45ee4b2f Mon Sep 17 00:00:00 2001 From: privaterookie <996514515@qq.com> Date: Mon, 13 Aug 2018 09:44:15 +0800 Subject: [PATCH] fix mistral dashbaord workflow execution form bug fix a bug that when a workflow has no input params, execution form will has a requried field with empty label Close-bug:#1786723 Change-Id: I49b2125ef649e94e210ff5df739684626c175172 --- mistraldashboard/workflows/forms.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/mistraldashboard/workflows/forms.py b/mistraldashboard/workflows/forms.py index dd11357..b37523f 100644 --- a/mistraldashboard/workflows/forms.py +++ b/mistraldashboard/workflows/forms.py @@ -45,15 +45,16 @@ class ExecuteForm(forms.SelfHandlingForm): for entry in list.split(","): label, _, default = entry.partition("=") label = label.strip() - self.workflow_parameters.append(label) - if default == "None": - default = None - required = False - else: - required = True - self.fields[label] = forms.CharField(label=label, - required=required, - initial=default) + if label != '': + self.workflow_parameters.append(label) + if default == "None": + default = None + required = False + else: + required = True + self.fields[label] = forms.CharField(label=label, + required=required, + initial=default) def handle(self, request, data): try: