bugfix in user_parser
parent
38d4e517b3
commit
1ba5e51c41
|
@ -37,8 +37,9 @@ def user_parser(dduser: DDUser) -> DDUser:
|
|||
user["role"] = user["roles"][0] if user.get("roles", []) else None
|
||||
user["groups"] = user.get("groups", user.get("keycloak_groups", []))
|
||||
# Compatibility for the API
|
||||
user["first"] = user["firstname"]
|
||||
user["last"] = user["lasttname"]
|
||||
for k1, k2 in [("first", "firstname"), ("last", "lastname")]:
|
||||
if k2 in user:
|
||||
user[k1] = user[k2]
|
||||
return user
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue