diff --git a/CHANGELOG.md b/CHANGELOG.md index 1783c865..6b570d97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [Unreleased] + +### Changed +- Handle case where user has not registered a `family-name` with ORCID + ## [4.5.4](https://github.com/python-social-auth/social-core/releases/tag/4.5.4) - 2024-04-25 ### Added diff --git a/social_core/backends/orcid.py b/social_core/backends/orcid.py index a2be9eaa..1f815f3b 100644 --- a/social_core/backends/orcid.py +++ b/social_core/backends/orcid.py @@ -76,7 +76,8 @@ def get_user_details(self, response): if name: first_name = name.get("given-names", {}).get("value", "") - last_name = name.get("family-name", {}).get("value", "") + if name.get("family-name", None) is not None: + last_name = name.get("family-name").get("value", "") emails = person.get("emails") if emails: