diff --git a/dd-sso/admin/src/admin/lib/callbacks.py b/dd-sso/admin/src/admin/lib/callbacks.py index 3298c20..5d39d4e 100644 --- a/dd-sso/admin/src/admin/lib/callbacks.py +++ b/dd-sso/admin/src/admin/lib/callbacks.py @@ -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