editAnnotation: explicitly refuse to change layer, fixes #2818
This commit is contained in:
parent
1ef7101761
commit
d3c18a5859
1 changed files with 3 additions and 0 deletions
|
@ -278,6 +278,9 @@ def editAnnotation(request, data):
|
|||
a = get_object_or_404_json(models.Annotation, public_id=data['id'])
|
||||
if a.editable(request.user):
|
||||
layer = get_by_id(settings.CONFIG['layers'], a.layer)
|
||||
if 'layer' in data and data['layer'] != a.layer:
|
||||
response = json_response(status=400, text='cannot change annotation layer')
|
||||
return render_to_json_response(response)
|
||||
for key in ('value', 'in', 'out'):
|
||||
if key in data:
|
||||
if key == 'value' and layer['type'] == 'entity':
|
||||
|
|
Loading…
Reference in a new issue