# HG changeset patch # User durandn # Date 1467627072 -7200 # Node ID 9f7e484baf738a9ec0468cce2433efd1dbf69500 # Parent 9b448d5307afa20b18ee64b1cc092506f2a7b3e1 Error handling in models + templates fixes diff -r 9b448d5307af -r 9f7e484baf73 src/iconolab/models.py --- 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 = [] diff -r 9b448d5307af -r 9f7e484baf73 src/iconolab/templates/iconolab/detail_annotation.html --- 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 @@

Description: {{ annotation.current_revision.description }}

Tags:

- - {% if user == annotation.creator %}Editer{% else %}Proposer une révision{% endif %} + {% if user == annotation.author %}Editer{% else %}Proposer une révision{% endif %} diff -r 9b448d5307af -r 9f7e484baf73 src/iconolab/templates/partials/header.html --- 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 @@