Pārlūkot izejas kodu

Fix PEP 8 errors

Lars Weiler 6 gadi atpakaļ
vecāks
revīzija
4c5603e6ff
1 mainītis faili ar 3 papildinājumiem un 2 dzēšanām
  1. 3 2
      netbox/utilities/middleware.py

+ 3 - 2
netbox/utilities/middleware.py

@@ -21,8 +21,9 @@ class LoginRequiredMiddleware(object):
             # Redirect unauthenticated requests to the login page. API requests are exempt from redirection as the API
             # Redirect unauthenticated requests to the login page. API requests are exempt from redirection as the API
             # performs its own authentication. Also metrics can be read without login.
             # performs its own authentication. Also metrics can be read without login.
             api_path = reverse('api-root')
             api_path = reverse('api-root')
-            if (not (request.path_info.startswith(api_path) or request.path_info.startswith('/metrics'))
-              and request.path_info != settings.LOGIN_URL):
+            if (not (request.path_info.startswith(api_path) or
+                     request.path_info.startswith('/metrics')) and
+                    request.path_info != settings.LOGIN_URL):
                 return HttpResponseRedirect('{}?next={}'.format(settings.LOGIN_URL, request.path_info))
                 return HttpResponseRedirect('{}?next={}'.format(settings.LOGIN_URL, request.path_info))
         return self.get_response(request)
         return self.get_response(request)