1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-03-16 02:47:31 +00:00
2020-10-28 17:40:14 +01:00

14 lines
333 B
Python

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:
d["matrix_username"] = f"corres2math_{self.user.pk}"
return d