diff options
author | Parker Berberian <pberberian@iol.unh.edu> | 2018-11-20 11:19:55 -0500 |
---|---|---|
committer | Parker Berberian <pberberian@iol.unh.edu> | 2018-11-26 14:07:15 -0500 |
commit | b7c4d286ffa618be0e95b15f3883e2f6920a3fb1 (patch) | |
tree | 930e9b9282b8f50e671844b2a1e7f39dc5d6035d /src/account/views.py | |
parent | 6a90796de1df8d74c79415c39c867ffe6cd80fd0 (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 'src/account/views.py')
-rw-r--r-- | src/account/views.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/account/views.py b/src/account/views.py index 04d21b8..09c5266 100644 --- a/src/account/views.py +++ b/src/account/views.py @@ -63,7 +63,7 @@ class JiraLoginView(RedirectView): # Step 1. Get a request token from Jira. try: resp, content = client.request(settings.OAUTH_REQUEST_TOKEN_URL, "POST") - except Exception as e: + except Exception: messages.add_message(self.request, messages.ERROR, 'Error: Connection to Jira failed. Please contact an Administrator') return '/' @@ -76,8 +76,8 @@ class JiraLoginView(RedirectView): self.request.session['request_token'] = dict(urllib.parse.parse_qsl(content.decode())) # Step 3. Redirect the user to the authentication URL. url = settings.OAUTH_AUTHORIZE_URL + '?oauth_token=' + \ - self.request.session['request_token']['oauth_token'] + \ - '&oauth_callback=' + settings.OAUTH_CALLBACK_URL + self.request.session['request_token']['oauth_token'] + \ + '&oauth_callback=' + settings.OAUTH_CALLBACK_URL return url @@ -99,7 +99,7 @@ class JiraAuthenticatedView(RedirectView): # Step 2. Request the authorized access token from Jira. try: resp, content = client.request(settings.OAUTH_ACCESS_TOKEN_URL, "POST") - except Exception as e: + except Exception: messages.add_message(self.request, messages.ERROR, 'Error: Connection to Jira failed. Please contact an Administrator') return '/' @@ -163,6 +163,7 @@ def account_detail_view(request): template = "account/details.html" return render(request, template) + def account_resource_view(request): """ gathers a users genericResoureBundles and @@ -175,6 +176,7 @@ def account_resource_view(request): context = {"resources": resources, "title": "My Resources"} return render(request, template, context=context) + def account_booking_view(request): if not request.user.is_authenticated: return render(request, "dashboard/login.html", {'title': 'Authentication Required'}) @@ -184,6 +186,7 @@ def account_booking_view(request): context = {"title": "My Bookings", "bookings": bookings, "collab_bookings": collab_bookings} return render(request, template, context=context) + def account_configuration_view(request): if not request.user.is_authenticated: return render(request, "dashboard/login.html", {'title': 'Authentication Required'}) @@ -192,12 +195,12 @@ def account_configuration_view(request): context = {"title": "Configuration List", "configurations": configs} return render(request, template, context=context) + def account_images_view(request): if not request.user.is_authenticated: return render(request, "dashboard/login.html", {'title': 'Authentication Required'}) template = "account/image_list.html" my_images = Image.objects.filter(owner=request.user) public_images = Image.objects.filter(public=True) - context = {"title": "Images", "images": my_images, "public_images": public_images } + context = {"title": "Images", "images": my_images, "public_images": public_images} return render(request, template, context=context) - |