From bf45f8f4d05d9842b285013cfcb0a0235ce51c5d Mon Sep 17 00:00:00 2001 From: Parker Berberian Date: Tue, 2 Jul 2019 17:33:09 -0400 Subject: 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 Signed-off-by: Sawyer Bergeron --- src/dashboard/views.py | 39 +++++++++------------------------------ 1 file changed, 9 insertions(+), 30 deletions(-) (limited to 'src/dashboard') 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): -- cgit 1.2.3-korg