aboutsummaryrefslogtreecommitdiffstats
path: root/python/fatcat_web
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2020-03-26 17:30:56 -0700
committerBryan Newbold <bnewbold@robocracy.org>2020-03-26 17:30:58 -0700
commit430d0a11c7470dc9a53df5db208de701b9f82110 (patch)
treede4baae547db700b9ca5008e0e9abb73ce37f046 /python/fatcat_web
parentec82404f0d0ad6b92491a1cb90a823d421857348 (diff)
downloadfatcat-430d0a11c7470dc9a53df5db208de701b9f82110.tar.gz
fatcat-430d0a11c7470dc9a53df5db208de701b9f82110.zip
web: copy extra.subtitle to subtitle for release view
The release view will display subtitles, but it needs to be in the correct "location".
Diffstat (limited to 'python/fatcat_web')
-rw-r--r--python/fatcat_web/entity_helpers.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/python/fatcat_web/entity_helpers.py b/python/fatcat_web/entity_helpers.py
index 591dda80..6dfac3df 100644
--- a/python/fatcat_web/entity_helpers.py
+++ b/python/fatcat_web/entity_helpers.py
@@ -72,6 +72,10 @@ def enrich_release_entity(entity):
# November 1.
if ref.extra and ref.extra.get('unstructured'):
ref.extra['unstructured'] = strip_extlink_xml(ref.extra['unstructured'])
+ # for backwards compatability, copy extra['subtitle'] to subtitle
+ if not entity.subtitle and entity.extra and entity.extra.get('subtitle'):
+ if type(entity.extra['subtitle']) == str:
+ entity.subtitle = entity.extra['subtitle']
# author list to display; ensure it's sorted by index (any othors with
# index=None go to end of list)
authors = [c for c in entity.contribs if c.role in ('author', None)]