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

15 lines
442 B
Python
Raw Normal View History

from cas_server.auth import DjangoAuthUser # pragma: no cover
2020-10-28 17:19:25 +01:00
class CustomAuthUser(DjangoAuthUser): # pragma: no cover
2020-10-28 17:19:25 +01:00
"""
Override Django Auth User model to define a custom Matrix username.
"""
def attributs(self):
d = super().attributs()
if self.user:
d["matrix_username"] = self.user.registration.matrix_username
d["display_name"] = str(self.user.registration)
2020-10-28 17:19:25 +01:00
return d