aboutsummaryrefslogtreecommitdiffstats
path: root/src/workflow/booking_workflow.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/workflow/booking_workflow.py')
-rw-r--r--src/workflow/booking_workflow.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/workflow/booking_workflow.py b/src/workflow/booking_workflow.py
index 8be7720..eb87728 100644
--- a/src/workflow/booking_workflow.py
+++ b/src/workflow/booking_workflow.py
@@ -59,11 +59,11 @@ class Resource_Select(WorkflowStep):
data = form.cleaned_data['generic_resource_bundle']
data = data[2:-2]
if not data:
- self.metastep.set_invalid("Please select a valid bundle")
+ self.set_invalid("Please select a valid bundle")
return render(request, self.template, context)
selected_bundle = json.loads(data)
if len(selected_bundle) < 1:
- self.metastep.set_invalid("Please select a valid bundle")
+ self.set_invalid("Please select a valid bundle")
return render(request, self.template, context)
selected_id = selected_bundle[0]['id']
gresource_bundle = None
@@ -86,11 +86,11 @@ class Resource_Select(WorkflowStep):
confirm[self.confirm_key]["resource name"] = gresource_bundle.name
self.repo_put(self.repo.CONFIRMATION, confirm)
messages.add_message(request, messages.SUCCESS, 'Form Validated Successfully', fail_silently=True)
- self.metastep.set_valid("Step Completed")
+ self.set_valid("Step Completed")
return render(request, self.template, context)
else:
messages.add_message(request, messages.ERROR, "Form Didn't Validate", fail_silently=True)
- self.metastep.set_invalid("Please complete the fields highlighted in red to continue")
+ self.set_invalid("Please complete the fields highlighted in red to continue")
return render(request, self.template, context)
@@ -135,11 +135,11 @@ class SWConfig_Select(WorkflowStep):
bundle_json = form.cleaned_data['software_bundle']
bundle_json = bundle_json[2:-2] # Stupid django string bug
if not bundle_json:
- self.metastep.set_invalid("Please select a valid config")
+ self.set_invalid("Please select a valid config")
return self.render(request)
bundle_json = json.loads(bundle_json)
if len(bundle_json) < 1:
- self.metastep.set_invalid("Please select a valid config")
+ self.set_invalid("Please select a valid config")
return self.render(request)
bundle = None
id = int(bundle_json[0]['id'])
@@ -148,7 +148,7 @@ class SWConfig_Select(WorkflowStep):
grb = self.repo_get(self.repo.SELECTED_GRESOURCE_BUNDLE)
if grb and bundle.bundle != grb:
- self.metastep.set_invalid("Incompatible config selected for resource bundle")
+ self.set_invalid("Incompatible config selected for resource bundle")
return self.render(request)
if not grb:
self.repo_set(self.repo.SELECTED_GRESOURCE_BUNDLE, bundle.bundle)
@@ -163,10 +163,10 @@ class SWConfig_Select(WorkflowStep):
confirm['booking'] = {}
confirm['booking']["configuration name"] = bundle.name
self.repo_put(self.repo.CONFIRMATION, confirm)
- self.metastep.set_valid("Step Completed")
+ self.set_valid("Step Completed")
messages.add_message(request, messages.SUCCESS, 'Form Validated Successfully', fail_silently=True)
else:
- self.metastep.set_invalid("Please select or create a valid config")
+ self.set_invalid("Please select or create a valid config")
messages.add_message(request, messages.ERROR, "Form Didn't Validate", fail_silently=True)
return self.render(request)
@@ -270,9 +270,9 @@ class Booking_Meta(WorkflowStep):
self.repo_put(self.repo.BOOKING_MODELS, models)
self.repo_put(self.repo.CONFIRMATION, confirm)
messages.add_message(request, messages.SUCCESS, 'Form Validated', fail_silently=True)
- self.metastep.set_valid("Step Completed")
+ self.set_valid("Step Completed")
else:
messages.add_message(request, messages.ERROR, "Form didn't validate", fail_silently=True)
- self.metastep.set_invalid("Please complete the fields highlighted in red to continue")
+ self.set_invalid("Please complete the fields highlighted in red to continue")
context['form'] = form # TODO: store this form
return render(request, self.template, context)