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 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'python/fatcat_web/routes.py') 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: -- cgit v1.2.3