diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2022-02-07 19:19:51 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2022-02-07 19:19:57 -0800 |
commit | 03397eb50097ffc8f2f1262352deb8d31bf5ef39 (patch) | |
tree | 358f9adeaca79b967e8f39a5c2f56a19dc8fbd32 /python/fatcat_web | |
parent | 752be5426178f4730326c6ca89d1fc20135a2509 (diff) | |
download | fatcat-03397eb50097ffc8f2f1262352deb8d31bf5ef39.tar.gz fatcat-03397eb50097ffc8f2f1262352deb8d31bf5ef39.zip |
web: handle abstract with no mimetype
Good example of a bug where type annotations on entity classes would
help.
Diffstat (limited to 'python/fatcat_web')
-rw-r--r-- | python/fatcat_web/entity_helpers.py | 2 |
1 files changed, 1 insertions, 1 deletions
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() |