bugfix in user_parser

mejoras_instalacion
Evilham 2022-08-06 21:34:41 +02:00
parent 38d4e517b3
commit 1ba5e51c41
No known key found for this signature in database
GPG Key ID: AE3EE30D970886BF
1 changed files with 3 additions and 2 deletions

View File

@ -37,8 +37,9 @@ def user_parser(dduser: DDUser) -> DDUser:
user["role"] = user["roles"][0] if user.get("roles", []) else None user["role"] = user["roles"][0] if user.get("roles", []) else None
user["groups"] = user.get("groups", user.get("keycloak_groups", [])) user["groups"] = user.get("groups", user.get("keycloak_groups", []))
# Compatibility for the API # Compatibility for the API
user["first"] = user["firstname"] for k1, k2 in [("first", "firstname"), ("last", "lastname")]:
user["last"] = user["lasttname"] if k2 in user:
user[k1] = user[k2]
return user return user