-
-
Notifications
You must be signed in to change notification settings - Fork 572
Fix setting fullname for ORCID #666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #666 +/- ##
=======================================
Coverage 77.78% 77.78%
=======================================
Files 352 352
Lines 10865 10866 +1
Branches 489 489
=======================================
+ Hits 8451 8452 +1
Misses 2234 2234
Partials 180 180
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| first_name = name.get('given-names', {}).get('value', '') | ||
| last_name = name.get('family-name', {}).get('value', '') | ||
| fullname = first_name + ' ' + last_name | ||
| fullname = fullname.strip() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please look why this is not covered by tests? The user data payload seems to be present in the test case, but it doesn't seem to be used.
|
Merged, thanks for your contribution! |
Originally, fullname was set to
response['person']['name'], which inORCID 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.
Proposed changes
The patch ensures that fullname is a string, in a similar way to how other backends do it.
Types of changes
Please check the type of change your PR introduces:
Checklist
(I had to install libxmlsec1-dev manually on debian in order to get tox to run.)