aboutsummaryrefslogtreecommitdiffstats
path: root/src/workflow/views.py
diff options
context:
space:
mode:
authorParker Berberian <pberberian@iol.unh.edu>2019-01-03 16:09:13 +0000
committerGerrit Code Review <gerrit@opnfv.org>2019-01-03 16:09:13 +0000
commitfdf6f46f9c548c8e3748f32840d3af2cb3335271 (patch)
tree6db479ec0c22d98a99e07b9f0a5a14e24a303a89 /src/workflow/views.py
parentb729dd4e21e90fe6f83b31cabdcc9f74757c70bd (diff)
parentf27e25c199c3c5c9433463732b776ae9b4357cf8 (diff)
Merge "Implement Segmented Workflows"
Diffstat (limited to 'src/workflow/views.py')
-rw-r--r--src/workflow/views.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/workflow/views.py b/src/workflow/views.py
index e5ef5c6..6d59b1c 100644
--- a/src/workflow/views.py
+++ b/src/workflow/views.py
@@ -30,6 +30,17 @@ def attempt_auth(request):
def delete_session(request):
+ manager = attempt_auth(request)
+
+ if not manager:
+ return HttpResponseGone("No session found that relates to current request")
+
+ if manager.pop_workflow():
+ return HttpResponse('')
+ else:
+ del ManagerTracker.managers[request.session['manager_session']]
+ return render(request, 'workflow/exit_redirect.html')
+
try:
del ManagerTracker.managers[request.session['manager_session']]
return HttpResponse('')
@@ -70,7 +81,8 @@ def manager_view(request):
logger.debug("edit found")
manager.add_workflow(workflow_type=request.POST.get('edit'), edit_object=int(request.POST.get('edit_id')))
elif request.POST.get('cancel') is not None:
- del ManagerTracker.managers[request.session['manager_session']]
+ if not manager.pop_workflow():
+ del ManagerTracker.managers[request.session['manager_session']]
return manager.status(request)