summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Wood <woodm1979@gmail.com>2013-12-11 11:30:28 -0700
committerDirk Mueller <dirk@dmllr.de>2014-01-22 10:15:51 +0100
commitce8611c3dc053c331170a9e6cc9813f9d6e4c756 (patch)
treef369692148369d2696c99330d203ead03453a406
parent2c1f1f39565ca7bdc8a7bde2ce45f2a0019357da (diff)
downloadhorizon-ce8611c3dc053c331170a9e6cc9813f9d6e4c756.tar.gz
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)
-rw-r--r--horizon/workflows/base.py10
1 files 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):