Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ORCID: backend crashes when no family name set in ORCID account #602

@byte-for-byte

Description

@byte-for-byte

Expected behaviour

Successful login through ORCID backend.

Actual behaviour

Authentication crashes with:
AttributeError: 'NoneType' object has no attribute 'get'

What are the steps to reproduce this issue?

  1. Create an ORCID account WITHOUT specifying a "Last Name".
  2. Try social auth

Any logs, error output, etc?

if "Last Name" is not provided in the ORCID account,
name in .../backends/orcid.py", about line 77 will be
name = {'created-date': {.... 'family-name': None, ....}

and in line 77, last_name = name.get('family-name', {}).get('value', '')

a get is used on a None type.

File ".../lib/python3.9/site-packages/social_core/backends/orcid.py", line 77, in get_user_details
last_name = name.get('family-name', {}).get('value', '')
AttributeError: 'NoneType' object has no attribute 'get'

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleStale issues (closing soon)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions