From c9be07e45a494aa639df3c962f83df41bf8e0cf2 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Wed, 28 Oct 2020 17:37:15 +0100 Subject: [PATCH] Matrix username should never change --- apps/registration/auth.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/registration/auth.py b/apps/registration/auth.py index 779aee3..4014de5 100644 --- a/apps/registration/auth.py +++ b/apps/registration/auth.py @@ -1,5 +1,4 @@ from cas_server.auth import DjangoAuthUser -from django.utils.text import slugify class CustomAuthUser(DjangoAuthUser): @@ -10,5 +9,5 @@ class CustomAuthUser(DjangoAuthUser): def attributs(self): d = super().attributs() if self.user: - d["matrix_username"] = slugify(str(self.user.registration)) + d["matrix_username"] = f"corres2math_{self.user.pk}" return d