1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-24 21:34:41 +03:00

Fixed "realname overwrite" on internaldb auth

This commit is contained in:
Adolfo Gómez García 2021-09-15 13:15:55 +02:00
parent 2400cc99cd
commit de9c06bc2c

View File

@ -158,6 +158,14 @@ class InternalDBAuth(auths.Authenticator):
groupsManager.validate([g.name for g in user.groups.all()])
def getRealName(self, username: str) -> str:
# Return the real name of the user, if it is set
try:
user = self.dbAuthenticator().users.get(name=username, state=State.ACTIVE)
return user.real_name or username
except Exception:
return super().getRealName(username)
def createUser(self, usrData):
pass