aboutsummaryrefslogtreecommitdiffstats
path: root/src/workflow/resource_bundle_workflow.py
diff options
context:
space:
mode:
authorParker Berberian <pberberian@iol.unh.edu>2018-12-14 10:31:34 -0500
committerParker Berberian <pberberian@iol.unh.edu>2018-12-14 10:31:34 -0500
commit5310da6a3c243ec1769b1cbde3acd42c53669f85 (patch)
tree7c8c1f021373dfa9db612b55bcd4d2d0845074c1 /src/workflow/resource_bundle_workflow.py
parent527d16d05016c029c022f77134f069af68218e61 (diff)
Force Lab Selection on POD Creation
Currently, a user can leave the "Define Hardware" step without choosing which lab thier pod should be at. This causes errors later in the pod creation process. This commit forces one lab to be selected before they can leave the first step. Change-Id: I7315bc8781ebeb66bcd32fdba30535100b59a3ff Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
Diffstat (limited to 'src/workflow/resource_bundle_workflow.py')
-rw-r--r--src/workflow/resource_bundle_workflow.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/workflow/resource_bundle_workflow.py b/src/workflow/resource_bundle_workflow.py
index 712c92b..11386f9 100644
--- a/src/workflow/resource_bundle_workflow.py
+++ b/src/workflow/resource_bundle_workflow.py
@@ -131,9 +131,12 @@ class Define_Hardware(WorkflowStep):
try:
self.form = HardwareDefinitionForm(request.POST)
if self.form.is_valid():
- self.update_models(self.form.cleaned_data)
- self.update_confirmation()
- self.metastep.set_valid("Step Completed")
+ if len(json.loads(self.form.cleaned_data['filter_field']).labs) != 1:
+ self.metastep.set_invalid("Please select one lab")
+ else:
+ self.update_models(self.form.cleaned_data)
+ self.update_confirmation()
+ self.metastep.set_valid("Step Completed")
else:
self.metastep.set_invalid("Please complete the fields highlighted in red to continue")
pass