Donne les attributes à get_username

This commit is contained in:
Robin Champenois 2021-01-17 21:35:11 +01:00
parent 4af5b9a90b
commit 0b54b16350

View file

@ -43,7 +43,7 @@ class ENSCASBackend:
def clean_cas_login(self, cas_login):
return cas_login.strip().lower()
def get_free_username(self, cas_login):
def get_free_username(self, cas_login, attributes):
"""Find an available username for a new user.
If you override this method, make sure it returns a username that is not taken
@ -102,7 +102,7 @@ class ENSCASBackend:
user = None
if user is None:
username = self.get_free_username(cas_login)
username = self.get_free_username(cas_login, attributes)
user = UserModel.objects.create_user(username=username, email=email)
CASAccount.objects.create(
user=user, entrance_year=entrance_year, cas_login=cas_login