Skip to content

Conversation

@hmpf
Copy link
Contributor

@hmpf hmpf commented Feb 15, 2022

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.

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:

  • Release (new release request)
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (PEP8, lint, formatting, renaming, etc)
  • Refactoring (no functional changes, no api changes)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Build related changes (build process, tests runner, etc)
  • Other (please describe):

Checklist

  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works

(I had to install libxmlsec1-dev manually on debian in order to get tox to run.)

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
Copy link

codecov bot commented Feb 15, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.78%. Comparing base (e672538) to head (79938ea).
Report is 1 commits behind head on master.

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           
Flag Coverage Δ
unittests 77.78% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

first_name = name.get('given-names', {}).get('value', '')
last_name = name.get('family-name', {}).get('value', '')
fullname = first_name + ' ' + last_name
fullname = fullname.strip()
Copy link
Member

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.

@nijel nijel enabled auto-merge (squash) May 26, 2025 14:00
@nijel nijel self-assigned this May 26, 2025
@nijel nijel merged commit cb99254 into python-social-auth:master May 26, 2025
12 checks passed
@nijel
Copy link
Member

nijel commented May 26, 2025

Merged, thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants