Skip to content

Commit cb99254

Browse files
hmpfnijelpre-commit-ci[bot]
authored
fix(backends) Fix setting fullname for ORCID (#666)
* 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. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update social_core/backends/orcid.py --------- Co-authored-by: Michal Čihař <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Michal Čihař <[email protected]>
1 parent e672538 commit cb99254

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

social_core/backends/orcid.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ def get_user_details(self, response):
7070
if person:
7171
name = person.get("name")
7272

73-
fullname = name
74-
7573
if name:
7674
first_name = name.get("given-names", {}).get("value", "")
7775
if (family_name := name.get("family-name", None)) is not None:
7876
last_name = family_name.get("value", "")
77+
fullname = first_name + " " + last_name
78+
fullname = fullname.strip()
7979

8080
emails = person.get("emails")
8181
if emails:

0 commit comments

Comments
 (0)