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["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
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue