Fix middleware due to failing tests

This commit is contained in:
Oliver Walters 2020-04-05 00:46:15 +11:00
parent 8b61acb048
commit 2d3e7e35af

View File

@ -63,7 +63,7 @@ class AuthRequiredMiddleware(object):
# No authorization was found for the request
if not authorized:
if not request.path_info == reverse_lazy('login') and not request.path_info == '/api/':
if not request.path_info == reverse_lazy('login') and not request.path_info.startswith('/api/'):
return HttpResponseRedirect(reverse_lazy('login'))
# Code to be executed for each request/response after