1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-02-06 16:13:01 +00:00

14 lines
333 B
Python
Raw Normal View History

2020-10-28 17:19:25 +01:00
from cas_server.auth import DjangoAuthUser
class CustomAuthUser(DjangoAuthUser):
"""
Override Django Auth User model to define a custom Matrix username.
"""
def attributs(self):
d = super().attributs()
if self.user:
2020-10-28 17:37:15 +01:00
d["matrix_username"] = f"corres2math_{self.user.pk}"
2020-10-28 17:19:25 +01:00
return d