1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2024-12-25 17:02:26 +00:00

Matrix username should never change

This commit is contained in:
Yohann D'ANELLO 2020-10-28 17:37:15 +01:00
parent 642ac94b7a
commit c9be07e45a

View File

@ -1,5 +1,4 @@
from cas_server.auth import DjangoAuthUser from cas_server.auth import DjangoAuthUser
from django.utils.text import slugify
class CustomAuthUser(DjangoAuthUser): class CustomAuthUser(DjangoAuthUser):
@ -10,5 +9,5 @@ class CustomAuthUser(DjangoAuthUser):
def attributs(self): def attributs(self):
d = super().attributs() d = super().attributs()
if self.user: if self.user:
d["matrix_username"] = slugify(str(self.user.registration)) d["matrix_username"] = f"corres2math_{self.user.pk}"
return d return d