diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2019-02-01 11:51:21 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2019-02-01 11:51:21 -0800 |
commit | fc6b8e0f96f0a0e69f4992525ba801d8f6639854 (patch) | |
tree | 7940b5779669ab6beef6ea3fb56317f8055826d6 /python/fatcat_web | |
parent | b90828d7d16b38052bd45f6df1f3d093799e7cee (diff) | |
download | fatcat-fc6b8e0f96f0a0e69f4992525ba801d8f6639854.tar.gz fatcat-fc6b8e0f96f0a0e69f4992525ba801d8f6639854.zip |
fixes for new elastic transform view code
Diffstat (limited to 'python/fatcat_web')
-rw-r--r-- | python/fatcat_web/routes.py | 8 | ||||
-rw-r--r-- | 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/<ident>/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. </div> {% endif %} -{% if container != None and container.es != None %} +{% if container != None and container.es %} <div class="ui segment attached"> <b>Container Metadata</b><br> {% if container.es.is_oa == True %} |