From 2846d5ab7b83f19740342f050f3d0ccfeacfa253 Mon Sep 17 00:00:00 2001 From: Hanne Moa Date: Tue, 15 Feb 2022 12:39:52 +0100 Subject: [PATCH] Fix setting fullname for ORCID Originally, fullname was set to `response['person']['name']`, which in ORCID is a large json object. Everywhere else, fullname is assumed to be a string. It cannot be used directly as a fullname but needs converting. --- social_core/backends/orcid.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/social_core/backends/orcid.py b/social_core/backends/orcid.py index e9cddb8e..1ca02363 100644 --- a/social_core/backends/orcid.py +++ b/social_core/backends/orcid.py @@ -70,11 +70,11 @@ def get_user_details(self, response): if person: name = person.get('name') - fullname = name - if name: first_name = name.get('given-names', {}).get('value', '') last_name = name.get('family-name', {}).get('value', '') + fullname = first_name + ' ' + last_name + fullname = fullname.strip() emails = person.get('emails') if emails: