summaryrefslogtreecommitdiffstats
path: root/dashboard/src/dashboard/views.py
diff options
context:
space:
mode:
authorParker Berberian <pberberian@iol.unh.edu>2018-11-20 11:19:55 -0500
committerParker Berberian <pberberian@iol.unh.edu>2018-11-26 14:07:15 -0500
commitf2bbdbbf7e03be031723a9680aa9deaf80e4a99c (patch)
tree54086b0ae60b65da0905e3b51c922934247b5370 /dashboard/src/dashboard/views.py
parent674812a20f6804c287e1355ec8a1adf907798a94 (diff)
Fix all flake8 errors
The flake8 command in test.sh finds no longer finds any errors. This may form a basis of a jenkins verify job as a sort of 'weak compile-time checks' The flake8 command will not complain about line length, and will not complain about django's manage.py file Change-Id: Ic47cb4fc7ada55e64485661ab6881aef475018ff Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
Diffstat (limited to 'dashboard/src/dashboard/views.py')
-rw-r--r--dashboard/src/dashboard/views.py39
1 files changed, 23 insertions, 16 deletions
diff --git a/dashboard/src/dashboard/views.py b/dashboard/src/dashboard/views.py
index 2d1f8b2..36c3253 100644
--- a/dashboard/src/dashboard/views.py
+++ b/dashboard/src/dashboard/views.py
@@ -14,12 +14,11 @@ from django.views.generic import TemplateView
from django.shortcuts import render
from django.http import HttpResponseRedirect
-from booking.models import Booking
from account.models import Lab
-from resource_inventory.models import *
-from workflow.views import *
-from workflow.workflow_manager import *
+from resource_inventory.models import Image, HostProfile
+from workflow.views import create_session
+from workflow.workflow_manager import ManagerTracker
def lab_list_view(request):
@@ -40,18 +39,27 @@ def lab_detail_view(request, lab_name):
if user:
images = images | Image.objects.filter(from_lab=lab).filter(owner=user)
- return render(request, "dashboard/lab_detail.html",
- {'title': "Lab Overview",
- 'lab': lab,
- 'hostprofiles': lab.hostprofiles.all(),
- 'images': images})
+ return render(
+ request,
+ "dashboard/lab_detail.html",
+ {
+ 'title': "Lab Overview",
+ 'lab': lab,
+ 'hostprofiles': lab.hostprofiles.all(),
+ 'images': images
+ }
+ )
def host_profile_detail_view(request):
- return render(request, "dashboard/host_profile_detail.html",
- {'title': "Host Types",
- })
+ return render(
+ request,
+ "dashboard/host_profile_detail.html",
+ {
+ 'title': "Host Types",
+ }
+ )
def landing_view(request):
@@ -62,12 +70,11 @@ def landing_view(request):
try:
manager = ManagerTracker.managers[request.session['manager_session']]
-
- except KeyError as e:
+ except KeyError:
pass
if manager is not None:
- #no manager detected, don't display continue button
+ # no manager detected, don't display continue button
manager_detected = True
if request.method == 'GET':
@@ -84,7 +91,7 @@ def landing_view(request):
request.session['manager_session'] = mgr_uuid
return HttpResponseRedirect('/wf/')
- except KeyError as e:
+ except KeyError:
pass