--- a/src/iconolab/models.py Mon Jul 04 11:59:18 2016 +0200
+++ b/src/iconolab/models.py Mon Jul 04 12:11:12 2016 +0200
@@ -255,7 +255,10 @@
)
results = json.loads(dbpedia_resp.text).get("results", {})
variable_bindings = results.get("bindings")
- label_json = variable_bindings.pop()
+ if variable_bindings:
+ label_json = variable_bindings.pop()
+ else:
+ label_json = {"l": {"value": "ERROR_LABEL"}}
return label_json.get("l").get("value")
final_list = []
--- a/src/iconolab/templates/iconolab/detail_annotation.html Mon Jul 04 11:59:18 2016 +0200
+++ b/src/iconolab/templates/iconolab/detail_annotation.html Mon Jul 04 12:11:12 2016 +0200
@@ -36,8 +36,7 @@
<p> <strong>Description:</strong> {{ annotation.current_revision.description }}</p>
<p><strong>Tags:</strong></p>
<typeahead :read-only="1" :tags="{{ tags_data }}"></typeahead>
-
- <a href="{% url 'annotation_edit' collection_name image_guid annotation_guid %}">{% if user == annotation.creator %}Editer{% else %}Proposer une révision{% endif %}</a>
+ <a href="{% url 'annotation_edit' collection_name image_guid annotation_guid %}">{% if user == annotation.author %}Editer{% else %}Proposer une révision{% endif %}</a>
</div>
</div>
--- a/src/iconolab/templates/partials/header.html Mon Jul 04 11:59:18 2016 +0200
+++ b/src/iconolab/templates/partials/header.html Mon Jul 04 12:11:12 2016 +0200
@@ -13,7 +13,7 @@
<ul class="nav navbar-nav">
<li class="active"><a href="#">Accueil</a></li>
<li><a href="#">Le projet</a></li>
- <li><a href="{% url 'collection_home' collection_name %}">Contribuer</a></li>
+ {% if collection_name %}<li><a href="{% url 'collection_home' collection_name %}">Contribuer</a></li>{% endif %}
</ul>
<form class="navbar-form navbar-left" role="search">