fix: name and surname were wrong
This commit is contained in:
@@ -27,6 +27,16 @@ def _normalize_fiscal_code(value):
|
||||
return fiscal_code
|
||||
|
||||
|
||||
def _first_present(mapping, *keys):
|
||||
if not isinstance(mapping, dict):
|
||||
return ""
|
||||
for key in keys:
|
||||
value = mapping.get(key)
|
||||
if value:
|
||||
return value
|
||||
return ""
|
||||
|
||||
|
||||
def _body_preview(raw_body, limit=512):
|
||||
if not raw_body:
|
||||
return ""
|
||||
@@ -92,8 +102,8 @@ class VisioneCompleteView(View):
|
||||
"issuer": issuer,
|
||||
"subject": subject,
|
||||
"fiscal_code": fiscal_code,
|
||||
"first_name": user_attrs.get("given_name", ""),
|
||||
"last_name": user_attrs.get("family_name", ""),
|
||||
"first_name": _first_present(user_attrs, "first_name", "given_name"),
|
||||
"last_name": _first_present(user_attrs, "last_name", "family_name"),
|
||||
"email": user_attrs.get("email", ""),
|
||||
}
|
||||
raw_body = json.dumps(payload, separators=(",", ":"))
|
||||
|
||||
Reference in New Issue
Block a user