From fc6b8e0f96f0a0e69f4992525ba801d8f6639854 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 1 Feb 2019 11:51:21 -0800 Subject: fixes for new elastic transform view code --- python/fatcat_web/routes.py | 8 +++++--- python/fatcat_web/templates/release_view.html | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/python/fatcat_web/routes.py b/python/fatcat_web/routes.py index d712be01..1cb0b4d4 100644 --- a/python/fatcat_web/routes.py +++ b/python/fatcat_web/routes.py @@ -87,7 +87,8 @@ def container_view(ident): return redirect('/container/{}'.format(entity.redirect)) if entity.state == "deleted": return render_template('deleted_entity.html', entity=entity) - entity.es = container_to_elasticsearch(entity, force_bool=False) + if entity.state == "active": + entity.es = container_to_elasticsearch(entity, force_bool=False) return render_template('container_view.html', container=entity) @app.route('/creator//history', methods=['GET']) @@ -247,9 +248,10 @@ def release_view(ident): return redirect('/release/{}'.format(entity.redirect)) if entity.state == "deleted": return render_template('deleted_entity.html', entity=entity) - if entity.container: + if entity.container and entity.container.state == "active": entity.container.es = container_to_elasticsearch(entity.container, force_bool=False) - entity.es = release_to_elasticsearch(entity, force_bool=False) + if entity.state == "active": + entity.es = release_to_elasticsearch(entity, force_bool=False) authors = [c for c in entity.contribs if c.role in ('author', None)] authors = sorted(authors, key=lambda c: c.index) for fe in files: diff --git a/python/fatcat_web/templates/release_view.html b/python/fatcat_web/templates/release_view.html index 3716f0cb..8962793a 100644 --- a/python/fatcat_web/templates/release_view.html +++ b/python/fatcat_web/templates/release_view.html @@ -210,7 +210,7 @@ This release citing other releases. {% endif %} -{% if container != None and container.es != None %} +{% if container != None and container.es %}
Container Metadata
{% if container.es.is_oa == True %} -- cgit v1.2.3