aboutsummaryrefslogtreecommitdiffstats
path: root/src/dashboard/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/dashboard/views.py')
-rw-r--r--src/dashboard/views.py41
1 files changed, 9 insertions, 32 deletions
diff --git a/src/dashboard/views.py b/src/dashboard/views.py
index aaad7ab..c387251 100644
--- a/src/dashboard/views.py
+++ b/src/dashboard/views.py
@@ -12,12 +12,10 @@
from django.shortcuts import get_object_or_404
from django.views.generic import TemplateView
from django.shortcuts import render
-from django.http import HttpResponseRedirect
from account.models import Lab
from resource_inventory.models import Image, HostProfile
-from workflow.views import create_session
from workflow.workflow_manager import ManagerTracker
@@ -63,36 +61,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):