Make identity deletion replay safe
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 1s

This commit is contained in:
tegwick 2026-07-29 23:34:46 +02:00
parent 26d0e52172
commit 12cdef5c7c
2 changed files with 14 additions and 2 deletions

View file

@ -153,10 +153,15 @@ mutation Remove($userId: String!, $groupId: Int!) {
return list(value["users"]), list(value["groups"])
def _user(self, token: str, subject: str) -> dict[str, Any] | None:
value = self._gql(token, """
try:
value = self._gql(token, """
query User($id: String!) {
user(userId: $id) { id email displayName groups { id displayName } }
}""", {"id": subject})
except ValueError as exc:
if "not found" in str(exc).lower():
return None
raise
user = value.get("user")
return dict(user) if user else None