From 419a4b40a52d9f096f113d4f3fb3a31ddf895e07 Mon Sep 17 00:00:00 2001
From: Carlos Vega <carlos.vega@uni.lu>
Date: Fri, 27 Nov 2020 10:54:58 +0100
Subject: [PATCH] replaced logout check with reverse check

---
 smash/web/middleware.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/smash/web/middleware.py b/smash/web/middleware.py
index e094a84f..bd57614b 100644
--- a/smash/web/middleware.py
+++ b/smash/web/middleware.py
@@ -1,5 +1,3 @@
-from django.contrib.auth.views import logout
-
 from web.models.constants import GLOBAL_STUDY_ID
 from web.models import Worker, Study
 from django.contrib import messages
@@ -21,7 +19,7 @@ class PrivacyNoticeMiddleware(MiddlewareMixin):
         if request.user.is_authenticated \
                 and not view_func == privacy_notice_accept \
                 and not request.user.is_superuser \
-                and not view_func == logout:
+                and not request.path == reverse('logout'):
             study = Study.objects.filter(id=GLOBAL_STUDY_ID)[0]
             worker = Worker.get_by_user(request.user)
             if worker is None:
-- 
GitLab