From c59fb1596fcda6dd1333eda723c62697f208bc0a Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 16 Apr 2015 20:50:59 +0530 Subject: [PATCH] fix entities with ' in name --- pandora/annotation/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandora/annotation/views.py b/pandora/annotation/views.py index 018967775..6244411e2 100644 --- a/pandora/annotation/views.py +++ b/pandora/annotation/views.py @@ -4,6 +4,7 @@ from __future__ import division from django.conf import settings +import ox from ox.utils import json from ox.django.decorators import login_required_json from ox.django.shortcuts import render_to_json_response, get_object_or_404_json, json_response, HttpErrorJson @@ -168,7 +169,7 @@ def addAnnotation(request, data): if layer['canAddAnnotations'].get(request.user.get_profile().get_level()): if layer['type'] == 'entity': try: - value = Entity.get_by_name(data['value'], layer['entity']).get_id() + value = Entity.get_by_name(ox.decode_html(data['value']), layer['entity']).get_id() except Entity.DoesNotExist: response = json_response({}) response['status']['text'] = 'unkown entity' @@ -281,7 +282,7 @@ def editAnnotation(request, data): if key in data: if key == 'value' and layer['type'] == 'entity': try: - value = Entity.get_by_name(data['value'], layer['entity']).get_id() + value = Entity.get_by_name(ox.decode_html(data['value']), layer['entity']).get_id() except Entity.DoesNotExist: response = json_response({}) response['status']['text'] = 'unkown entity'