diff options
author | Parker Berberian <pberberian@iol.unh.edu> | 2019-01-03 16:09:13 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2019-01-03 16:09:13 +0000 |
commit | fdf6f46f9c548c8e3748f32840d3af2cb3335271 (patch) | |
tree | 6db479ec0c22d98a99e07b9f0a5a14e24a303a89 /src/workflow/views.py | |
parent | b729dd4e21e90fe6f83b31cabdcc9f74757c70bd (diff) | |
parent | f27e25c199c3c5c9433463732b776ae9b4357cf8 (diff) |
Merge "Implement Segmented Workflows"
Diffstat (limited to 'src/workflow/views.py')
-rw-r--r-- | src/workflow/views.py | 14 |
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) |