forked from 0x2620/pandora
fix editing annotation in/out
This commit is contained in:
parent
6741ae85e6
commit
3b8abd7d23
1 changed files with 10 additions and 10 deletions
|
@ -278,6 +278,7 @@ def editAnnotation(request, data):
|
||||||
if a.editable(request.user):
|
if a.editable(request.user):
|
||||||
layer = get_by_id(settings.CONFIG['layers'], a.layer)
|
layer = get_by_id(settings.CONFIG['layers'], a.layer)
|
||||||
for key in ('value', 'in', 'out'):
|
for key in ('value', 'in', 'out'):
|
||||||
|
if key in data:
|
||||||
if key == 'value' and layer['type'] == 'entity':
|
if key == 'value' and layer['type'] == 'entity':
|
||||||
try:
|
try:
|
||||||
value = Entity.get_by_name(data['value']).get_id()
|
value = Entity.get_by_name(data['value']).get_id()
|
||||||
|
@ -288,7 +289,6 @@ def editAnnotation(request, data):
|
||||||
return render_to_json_response(response)
|
return render_to_json_response(response)
|
||||||
else:
|
else:
|
||||||
value = data[key]
|
value = data[key]
|
||||||
if key in data:
|
|
||||||
setattr(a, {
|
setattr(a, {
|
||||||
'in': 'start',
|
'in': 'start',
|
||||||
'out': 'end'
|
'out': 'end'
|
||||||
|
|
Loading…
Reference in a new issue