From 9326a6be300577965f7378bffbf6771240f52ad5 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Wed, 12 May 2021 20:56:17 +0300 Subject: Fix custom middleware --- servo/lib/middleware.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'servo/lib/middleware.py') diff --git a/servo/lib/middleware.py b/servo/lib/middleware.py index 0ee054a..89675e1 100644 --- a/servo/lib/middleware.py +++ b/servo/lib/middleware.py @@ -33,9 +33,9 @@ class LoginRequiredMiddleware: 'django.contrib.auth.middlware.AuthenticationMiddleware'. If that doesn't\ work, ensure your TEMPLATE_CONTEXT_PROCESSORS setting includes\ 'django.core.context_processors.auth'." - if not request.user.is_authenticated(): + if request.user.is_authenticated() == False: path = request.path_info.lstrip('/') - if not any(m.match(path) for m in EXEMPT_URLS): + if any(m.match(path) for m in EXEMPT_URLS) == False: return HttpResponseRedirect(settings.LOGIN_URL) return response -- cgit v1.2.3