From ec8566ea5d224f9ba1daf995107ada18baa7b61e Mon Sep 17 00:00:00 2001 From: Sawyer Bergeron Date: Mon, 17 Jun 2019 13:10:01 -0400 Subject: Enforce step validity when going forward Change-Id: Ic598a5e2637b88f6d044bd93c5b597582f0c1081 Signed-off-by: Sawyer Bergeron --- src/workflow/workflow_manager.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/workflow') diff --git a/src/workflow/workflow_manager.py b/src/workflow/workflow_manager.py index 26f926e..80b8a67 100644 --- a/src/workflow/workflow_manager.py +++ b/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") -- cgit 1.2.3-korg