mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-02-11 17:41:18 +00:00
15 lines
393 B
Python
15 lines
393 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}"
|
|
d["display_name"] = str(self.user.registration)
|
|
return d
|