From f2bbdbbf7e03be031723a9680aa9deaf80e4a99c Mon Sep 17 00:00:00 2001 From: Parker Berberian Date: Tue, 20 Nov 2018 11:19:55 -0500 Subject: 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 --- dashboard/src/dashboard/views.py | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) (limited to 'dashboard/src/dashboard/views.py') 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 -- cgit 1.2.3-korg