From 03397eb50097ffc8f2f1262352deb8d31bf5ef39 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 7 Feb 2022 19:19:51 -0800 Subject: web: handle abstract with no mimetype Good example of a bug where type annotations on entity classes would help. --- python/fatcat_web/entity_helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/fatcat_web/entity_helpers.py b/python/fatcat_web/entity_helpers.py index 285513a8..0228ca12 100644 --- a/python/fatcat_web/entity_helpers.py +++ b/python/fatcat_web/entity_helpers.py @@ -109,7 +109,7 @@ def enrich_release_entity(entity: ReleaseEntity) -> ReleaseEntity: entity._authors = sorted(authors, key=lambda c: (c.index is None and 99999999) or c.index) # need authors, title for citeproc to work entity._can_citeproc = bool(entity._authors) and bool(entity.title) - if entity.abstracts: + if entity.abstracts and entity.abstracts[0].mimetype: # hack to show plain text instead of latex abstracts if "latex" in entity.abstracts[0].mimetype: entity.abstracts.reverse() -- cgit v1.2.3