From e253b917876eeb36b1dc00006199aa62f33c3795 Mon Sep 17 00:00:00 2001 From: jnptk <110389276+jnptk@users.noreply.github.com> Date: Mon, 6 Oct 2025 18:10:47 +0200 Subject: [PATCH] return mobile if present and otherwise phone --- src/kitconcept/contentsync/converters/keycloak.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kitconcept/contentsync/converters/keycloak.py b/src/kitconcept/contentsync/converters/keycloak.py index 08e5b7b..21bda72 100644 --- a/src/kitconcept/contentsync/converters/keycloak.py +++ b/src/kitconcept/contentsync/converters/keycloak.py @@ -33,11 +33,11 @@ def _field_title(self, src: t.KeycloakUser) -> str: return f"{last_name}, {first_name}" def _field_contact_phone(self, src: t.KeycloakUser) -> str: - """Constructs the title from the first and last name.""" + """Extract the mobile or phone number from the user attributes.""" attrs = src.get("attributes", {}) or {} phone = attrs.get("phone", [""])[0] mobile = attrs.get("mobile", [""])[0] - return phone or mobile + return mobile or phone def _blocks_factory_(self, src: t.KeycloakUser) -> VoltoBlocksInfo: """Constructs the blocks for the user."""