aboutsummaryrefslogtreecommitdiffstats
path: root/src/workflow/workflow_manager.py
diff options
context:
space:
mode:
authorSawyer Bergeron <sbergeron@iol.unh.edu>2019-06-06 12:45:32 -0400
committerSawyer Bergeron <sbergeron@iol.unh.edu>2019-06-12 11:39:59 -0400
commitec2f0d1340d0548aedc5773788e241d1558fa1ed (patch)
tree45959a60d910a8d76e7cfc7130a972356245e8ff /src/workflow/workflow_manager.py
parent48e42996ef463ca03664fbeafa047b1338998686 (diff)
redirect to booking detail on creation
Change-Id: I4e27f6a4a64314639b9ac83750b5b6add069399b Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
Diffstat (limited to 'src/workflow/workflow_manager.py')
-rw-r--r--src/workflow/workflow_manager.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/workflow/workflow_manager.py b/src/workflow/workflow_manager.py
index 525aa6f..26f926e 100644
--- a/src/workflow/workflow_manager.py
+++ b/src/workflow/workflow_manager.py
@@ -64,15 +64,15 @@ class SessionManager():
)
def pop_workflow(self):
- if(len(self.workflows) <= 1):
- return False
-
- if self.workflows[-1].repository.el[self.workflows[-1].repository.HAS_RESULT]:
- key = self.workflows[-1].repository.el[self.workflows[-1].repository.RESULT_KEY]
- result = self.workflows[-1].repository.el[self.workflows[-1].repository.RESULT]
- self.workflows[-2].repository.el[key] = result
- self.workflows.pop()
- return True
+ multiple_wfs = len(self.workflows) > 1
+ if multiple_wfs:
+ if self.workflows[-1].repository.el[Repository.RESULT]: # move result
+ key = self.workflows[-1].repository.el[Repository.RESULT_KEY]
+ result = self.workflows[-1].repository.el[Repository.RESULT]
+ self.workflows[-2].repository.el[key] = result
+ self.workflows.pop()
+ current_repo = self.workflows[-1].repository
+ return (multiple_wfs, current_repo.el[current_repo.RESULT])
def status(self, request):
try: