Skip to content

Commit

Permalink
Fix setting fullname for ORCID
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hmpf committed Feb 15, 2022
1 parent 98c81ad commit 2846d5a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions social_core/backends/orcid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 2846d5a

Please sign in to comment.