Fix backend

This commit is contained in:
Ludovic Stephan 2020-06-13 19:45:22 +02:00
parent 99e84f04ad
commit 1c9ecb5eb9

View file

@ -168,3 +168,10 @@ class OldCASBackend:
# Taken from Django's ModelBackend
is_active = getattr(user, "is_active", None)
return is_active or is_active is None
# Django boilerplate.
def get_user(self, user_id):
try:
return UserModel.objects.get(pk=user_id)
except UserModel.DoesNotExist:
return None