From 2d3e7e35afcc1112f7ba4ef6e6387a00adf96a2f Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sun, 5 Apr 2020 00:46:15 +1100 Subject: [PATCH] Fix middleware due to failing tests --- InvenTree/InvenTree/middleware.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InvenTree/InvenTree/middleware.py b/InvenTree/InvenTree/middleware.py index 1f8fcf7830..8a2c0b17a4 100644 --- a/InvenTree/InvenTree/middleware.py +++ b/InvenTree/InvenTree/middleware.py @@ -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