mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-07-04 19:04:03 +02:00
Use a custom Matrix username
This commit is contained in:
14
apps/registration/auth.py
Normal file
14
apps/registration/auth.py
Normal file
@ -0,0 +1,14 @@
|
||||
from cas_server.auth import DjangoAuthUser
|
||||
from django.utils.text import slugify
|
||||
|
||||
|
||||
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"] = slugify(str(self.user.registration))
|
||||
return d
|
Reference in New Issue
Block a user