handle unknown entities.
This commit is contained in:
parent
a9297b778d
commit
beca371b43
3 changed files with 20 additions and 10 deletions
|
|
@ -77,7 +77,10 @@ def add_annotations(data):
|
|||
user = User.objects.get(username=data['user'])
|
||||
for a in data['annotations']:
|
||||
if layer['type'] == 'entity':
|
||||
value = Entity.get_by_name(a['value']).get_id()
|
||||
try:
|
||||
value = Entity.get_by_name(a['value']).get_id()
|
||||
except Entity.DoesNotExist:
|
||||
continue
|
||||
else:
|
||||
value = a['value']
|
||||
annotation = models.Annotation(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue