aboutsummaryrefslogtreecommitdiffstats
path: root/src/workflow/snapshot_workflow.py
diff options
context:
space:
mode:
authorSawyer Bergeron <sbergeron@iol.unh.edu>2019-07-01 15:17:52 -0400
committerSawyer Bergeron <sbergeron@iol.unh.edu>2019-07-02 08:22:36 -0400
commit08ed74b95826a907ba8f9797002ef98eb2e82424 (patch)
treef4dc0936b418fed16a6e18f3338a5b6760d241bf /src/workflow/snapshot_workflow.py
parent8149a888fe6f7c1c3b1b3be2b3996c6d225d5a53 (diff)
add post to steps (LAAS-32)
Change-Id: I3fa53c399f914d7daa8ffb5d8640a153de555421 Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
Diffstat (limited to 'src/workflow/snapshot_workflow.py')
-rw-r--r--src/workflow/snapshot_workflow.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/workflow/snapshot_workflow.py b/src/workflow/snapshot_workflow.py
index 5414784..4266587 100644
--- a/src/workflow/snapshot_workflow.py
+++ b/src/workflow/snapshot_workflow.py
@@ -49,15 +49,15 @@ class Select_Host_Step(WorkflowStep):
context['chosen'] = chosen
return context
- def post_render(self, request):
- host_data = request.POST.get("host")
+ def post(self, post_data, user):
+ host_data = post_data.get("host")
if not host_data:
self.set_invalid("Please select a host")
- return self.render(request)
+ return
host = json.loads(host_data)
if 'name' not in host or 'booking' not in host:
self.set_invalid("Invalid host selected")
- return self.render(request)
+ return
name = host['name']
booking_id = host['booking']
booking = Booking.objects.get(pk=booking_id)
@@ -76,7 +76,6 @@ class Select_Host_Step(WorkflowStep):
confirm['snapshot'] = snap_confirm
self.repo_put(self.repo.CONFIRMATION, confirm)
self.set_valid("Success")
- return self.render(request)
class Image_Meta_Step(WorkflowStep):
@@ -97,8 +96,8 @@ class Image_Meta_Step(WorkflowStep):
context['form'] = form
return context
- def post_render(self, request):
- form = BasicMetaForm(request.POST)
+ def post(self, post_data, user):
+ form = BasicMetaForm(post_data)
if form.is_valid():
name = form.cleaned_data['name']
self.repo_put(self.repo.SNAPSHOT_NAME, name)
@@ -115,5 +114,3 @@ class Image_Meta_Step(WorkflowStep):
self.set_valid("Success")
else:
self.set_invalid("Please Fill out the Form")
-
- return self.render(request)