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