1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Forgot the additional brackets for a tuple

This commit is contained in:
Lars Weiler
2019-04-30 17:04:21 +02:00
parent 560c8d6f01
commit 2a2026a2cc

View File

@ -21,7 +21,7 @@ class LoginRequiredMiddleware(object):
# 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.
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 self.get_response(request)