فهرست منبع

Forgot the additional brackets for a tuple

Lars Weiler 6 سال پیش
والد
کامیت
2a2026a2cc
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      netbox/utilities/middleware.py

+ 1 - 1
netbox/utilities/middleware.py

@@ -21,7 +21,7 @@ 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, '/metrics') and request.path_info != settings.LOGIN_URL:
+            if not request.path_info.startswith((api_path, '/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)