diff --git a/pandora/annotation/models.py b/pandora/annotation/models.py index 7e7085cc6..cfd2f35cf 100644 --- a/pandora/annotation/models.py +++ b/pandora/annotation/models.py @@ -228,7 +228,7 @@ class Annotation(models.Model): try: entity = Entity.get(self.value) j['entity'] = entity.json(user=user) - j['value'] = entity.name + j['value'] = entity.html_link() except: j['entity'] = {} elif l['type'] == 'event': diff --git a/pandora/annotation/views.py b/pandora/annotation/views.py index 6a6f0ba6c..018967775 100644 --- a/pandora/annotation/views.py +++ b/pandora/annotation/views.py @@ -283,8 +283,7 @@ def editAnnotation(request, data): try: value = Entity.get_by_name(data['value'], layer['entity']).get_id() except Entity.DoesNotExist: - response['data'] = a.json() - response['data']['editable'] = True + response = json_response({}) response['status']['text'] = 'unkown entity' return render_to_json_response(response) else: diff --git a/pandora/entity/models.py b/pandora/entity/models.py index f9dc58783..3bcce31e3 100644 --- a/pandora/entity/models.py +++ b/pandora/entity/models.py @@ -141,6 +141,8 @@ class Entity(models.Model): response[key] = self.data[key] return response + def html_link(self): + return '%s' % (self.get_id(), ox.escape_html(self.name)) def update_matches(self): import annotation.models