From 4871b00983b7105aab8087ec4882fad922d39707 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 12 Apr 2021 16:36:46 -0700 Subject: indexing: defer to creator.display_name over contrib.raw_name --- fatcat_scholar/schema.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fatcat_scholar/schema.py b/fatcat_scholar/schema.py index b93962c..9912a97 100644 --- a/fatcat_scholar/schema.py +++ b/fatcat_scholar/schema.py @@ -452,7 +452,9 @@ def scrub_text(raw: str, mimetype: str = None) -> Optional[str]: def contrib_name(contrib: ReleaseContrib) -> str: # TODO: support more cultural normals for name presentation - if contrib.raw_name: + if contrib.creator and contrib.creator.display_name: + return contrib.creator.display_name + elif contrib.raw_name: return contrib.raw_name elif contrib.given_name and contrib.surname: return f"{contrib.given_name} {contrib.surname}" -- cgit v1.2.3