aboutsummaryrefslogtreecommitdiffstats
path: root/src/dashboard/views.py
diff options
context:
space:
mode:
authorParker Berberian <pberberian@iol.unh.edu>2019-07-02 17:33:09 -0400
committerSawyer Bergeron <sbergeron@iol.unh.edu>2019-07-08 14:32:53 +0000
commitbf45f8f4d05d9842b285013cfcb0a0235ce51c5d (patch)
tree528ceb8bf7627a65ed771ac3738031778e8750c8 /src/dashboard/views.py
parente0b8bb3ee3c218a65562acdc5e76f714aab92926 (diff)
Hacking on AJAX
This change incorporates the multiple changes we've made in the past few days in order to actually get AJAX working. Change-Id: Ia61a0395e7dbac26a143ca6e15049e6a4bdc8b0d Signed-off-by: Parker Berberian <pberberian@iol.unh.edu> Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
Diffstat (limited to 'src/dashboard/views.py')
-rw-r--r--src/dashboard/views.py39
1 files changed, 9 insertions, 30 deletions
diff --git a/src/dashboard/views.py b/src/dashboard/views.py
index aaad7ab..9416cb4 100644
--- a/src/dashboard/views.py
+++ b/src/dashboard/views.py
@@ -63,36 +63,15 @@ def host_profile_detail_view(request):
def landing_view(request):
- manager = None
- manager_detected = False
- if 'manager_session' in request.session:
-
- try:
- manager = ManagerTracker.managers[request.session['manager_session']]
-
- except KeyError:
- pass
-
- if manager is not None:
- # no manager detected, don't display continue button
- manager_detected = True
-
- if request.method == 'GET':
- return render(request, 'dashboard/landing.html', {'manager': manager_detected, 'title': "Welcome to the Lab as a Service Dashboard"})
-
- if request.method == 'POST':
- try:
- create = request.POST['create']
-
- if manager is not None:
- del manager
-
- mgr_uuid = create_session(create, request=request,)
- request.session['manager_session'] = mgr_uuid
- return HttpResponseRedirect('/wf/')
-
- except KeyError:
- pass
+ manager = ManagerTracker.managers.get(request.session.get('manager_session'))
+ return render(
+ request,
+ 'dashboard/landing.html',
+ {
+ 'manager': manager is not None,
+ 'title': "Welcome to the Lab as a Service Dashboard"
+ }
+ )
class LandingView(TemplateView):