summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/fatcat_web/routes.py8
-rw-r--r--python/fatcat_web/templates/release_view.html2
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 %}