addAnnotations: report which key is missing in error

This commit is contained in:
Will Thompson 2015-11-20 11:06:30 +00:00
parent 729856eb30
commit cdaa50c4d3

View file

@ -220,8 +220,9 @@ def addAnnotations(request, data):
'''
for key in ('item', 'layer', 'annotations'):
if key not in data:
return render_to_json_response(json_response(status=400,
text='invalid data'))
return render_to_json_response(json_response(
status=400,
text='invalid data (missing "{}")'.format(key)))
item = get_object_or_404_json(Item, public_id=data['item'])