summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSawyer Bergeron <sbergeron@iol.unh.edu>2019-06-17 13:10:01 -0400
committerSawyer Bergeron <sbergeron@iol.unh.edu>2019-06-17 13:10:01 -0400
commit2c7b239fc5877e2674f8c952fd1b522b4d06bcbe (patch)
treee57807ca048e94161c456e06794f25e7e8227416
parent02e6d84590dac42d3157f563faa248acdb6503df (diff)
Enforce step validity when going forward
Change-Id: Ic598a5e2637b88f6d044bd93c5b597582f0c1081 Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
-rw-r--r--dashboard/src/templates/workflow/viewport-base.html3
-rw-r--r--dashboard/src/workflow/workflow_manager.py6
2 files changed, 7 insertions, 2 deletions
diff --git a/dashboard/src/templates/workflow/viewport-base.html b/dashboard/src/templates/workflow/viewport-base.html
index beea7d2..4608ef9 100644
--- a/dashboard/src/templates/workflow/viewport-base.html
+++ b/dashboard/src/templates/workflow/viewport-base.html
@@ -187,8 +187,7 @@
{
if( errors_exist(data) )
{
- var continueanyway = confirm("The current step has errors that will prevent it from saving. Continue anyway?");
- if( !continueanyway )
+ if( to != "prev" )
{
return;
}
diff --git a/dashboard/src/workflow/workflow_manager.py b/dashboard/src/workflow/workflow_manager.py
index 26f926e..80b8a67 100644
--- a/dashboard/src/workflow/workflow_manager.py
+++ b/dashboard/src/workflow/workflow_manager.py
@@ -97,7 +97,13 @@ class SessionManager():
def post_render(self, request):
return self.active_workflow().steps[self.active_workflow().active_index].post_render(request)
+ def get_active_step(self):
+ return self.active_workflow().steps[self.active_workflow().active_index]
+
def go_next(self, **kwargs):
+ # need to verify current step is valid to allow this
+ if self.get_active_step().valid < 200:
+ return
next_step = self.active_workflow().active_index + 1
if next_step >= len(self.active_workflow().steps):
raise Exception("Out of bounds request for step")