From 3b8abd7d2357d6b27071da5506d596987c5f19da Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 26 Dec 2014 13:00:54 +0000 Subject: [PATCH] fix editing annotation in/out --- pandora/annotation/views.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pandora/annotation/views.py b/pandora/annotation/views.py index dc16ce32f..275c1c90a 100644 --- a/pandora/annotation/views.py +++ b/pandora/annotation/views.py @@ -278,17 +278,17 @@ def editAnnotation(request, data): if a.editable(request.user): layer = get_by_id(settings.CONFIG['layers'], a.layer) for key in ('value', 'in', 'out'): - if key == 'value' and layer['type'] == 'entity': - try: - value = Entity.get_by_name(data['value']).get_id() - except Entity.DoesNotExist: - response['data'] = a.json() - response['data']['editable'] = True - response['status']['text'] = 'unkown entity' - return render_to_json_response(response) - else: - value = data[key] if key in data: + if key == 'value' and layer['type'] == 'entity': + try: + value = Entity.get_by_name(data['value']).get_id() + except Entity.DoesNotExist: + response['data'] = a.json() + response['data']['editable'] = True + response['status']['text'] = 'unkown entity' + return render_to_json_response(response) + else: + value = data[key] setattr(a, { 'in': 'start', 'out': 'end'