[sso-admin] Fix bug in user_parser
parent
3fa0d48858
commit
519146a58f
|
@ -34,7 +34,9 @@ DDUser = Dict[str, Any]
|
|||
def user_parser(dduser: DDUser) -> DDUser:
|
||||
user = copy.deepcopy(dduser)
|
||||
user["keycloak_id"] = user.pop("id")
|
||||
user["role"] = user["roles"][0] if user.get("roles", []) else None
|
||||
if "password" in user:
|
||||
user.pop("password")
|
||||
user["role"] = user["roles"][0] if user.get("roles", []) else user.get("role", None)
|
||||
user["groups"] = user.get("groups", user.get("keycloak_groups", []))
|
||||
# Compatibility for the API
|
||||
for k1, k2 in [("first", "firstname"), ("last", "lastname")]:
|
||||
|
|
Loading…
Reference in New Issue