From 329264715e13080ecea96486ee173752f55f0f75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Bastian?= Date: Tue, 7 Nov 2017 14:03:37 +0100 Subject: [PATCH] Fix error 500: anonymous user has no CAS --- bocal_auth/rhosts.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bocal_auth/rhosts.py b/bocal_auth/rhosts.py index 1b9230e..bd6d9a3 100644 --- a/bocal_auth/rhosts.py +++ b/bocal_auth/rhosts.py @@ -72,6 +72,8 @@ def grantBOcalPrivileges(user): def requireCasUser(fct): def hasCas(user): + if user.is_anonymous: + return False return CasUser.objects.filter(user=user).count() > 0 def wrap(user, *args, **kwargs):