From ce8611c3dc053c331170a9e6cc9813f9d6e4c756 Mon Sep 17 00:00:00 2001 From: Matthew Wood Date: Wed, 11 Dec 2013 11:30:28 -0700 Subject: Bad workflow-steps check: has_required_fields Many of the tabs on the Instance Creation screen don't show a "*" despite having require fields. This is due to faulty logic in determining whether the workflow-step has require fields. (Previously, only keys from the contributes list were checked.) Closes-Bug: 1252005 Change-Id: Id609da27c51f8d4725683d7fd1534ead0c3bb984 (cherry picked from commit 788ec08c4f3e53b1f3dbaa40c19a0a71c21cdf42) --- horizon/workflows/base.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/horizon/workflows/base.py b/horizon/workflows/base.py index 0c8c2004b..1e5968a4c 100644 --- a/horizon/workflows/base.py +++ b/horizon/workflows/base.py @@ -447,14 +447,8 @@ class Step(object): self.action.add_error(message) def has_required_fields(self): - """ - Returns True if action contains any required fields - """ - for key in self.contributes: - field = self.action.fields.get(key, None) - if (field and field.required): - return True - return False + """Returns True if action contains any required fields.""" + return any(field.required for field in self.action.fields.values()) class WorkflowMetaclass(type): -- cgit v1.2.1