Fix error 500: anonymous user has no CAS

This commit is contained in:
Théophile Bastian 2017-11-07 14:03:37 +01:00
parent 3b922ec7ca
commit 329264715e

View file

@ -72,6 +72,8 @@ def grantBOcalPrivileges(user):
def requireCasUser(fct): def requireCasUser(fct):
def hasCas(user): def hasCas(user):
if user.is_anonymous:
return False
return CasUser.objects.filter(user=user).count() > 0 return CasUser.objects.filter(user=user).count() > 0
def wrap(user, *args, **kwargs): def wrap(user, *args, **kwargs):