Commit fdf52bee authored by Pierre-Elliott Bécue's avatar Pierre-Elliott Bécue

Parfois, l'username vaut none, et .lower ne marche pas.

parent 06d93a92
......@@ -41,12 +41,13 @@ class CransCASBackend(CASBackend):
utilisateur django s'il n'existe pas encore."""
username, attributes = _verify(ticket, service)
# Si _verify plante, username contient None.
if username is None or not username:
return None
# Sanitize username
username = username.lower()
if attributes:
request.session['attributes'] = attributes
if not username:
return None
try:
user = User.objects.get(username=username)
except User.DoesNotExist:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment