forked from 0x2620/pandora
dont fail with no added annotations
This commit is contained in:
parent
5c31e3870d
commit
f1db36dd26
1 changed files with 7 additions and 5 deletions
|
@ -77,6 +77,7 @@ def add_annotations(data):
|
|||
else:
|
||||
layer = layer[0]
|
||||
user = User.objects.get(username=data['user'])
|
||||
annotation = None
|
||||
for a in data['annotations']:
|
||||
if layer['type'] == 'entity':
|
||||
try:
|
||||
|
@ -95,6 +96,7 @@ def add_annotations(data):
|
|||
#update facets if needed
|
||||
if layer_id in item.facet_keys:
|
||||
item.update_layer_facet(layer_id)
|
||||
if annotation:
|
||||
Item.objects.filter(id=item.id).update(modified=annotation.modified)
|
||||
annotation.item.modified = annotation.modified
|
||||
annotation.item.update_find()
|
||||
|
|
Loading…
Reference in a new issue