forked from 0x2620/pandora
get entity by id after all
This commit is contained in:
parent
61bf668957
commit
15fb864d74
1 changed files with 3 additions and 3 deletions
|
@ -226,10 +226,10 @@ class Annotation(models.Model):
|
||||||
j['languages'] = self.languages.split(',')
|
j['languages'] = self.languages.split(',')
|
||||||
l = self.get_layer()
|
l = self.get_layer()
|
||||||
if l['type'] == 'entity':
|
if l['type'] == 'entity':
|
||||||
entity = Entity.get_by_name(self.value)
|
try:
|
||||||
if entity > 0:
|
entity = Entity.get(self.value)
|
||||||
j['entity'] = entity.json(user=user)
|
j['entity'] = entity.json(user=user)
|
||||||
else:
|
except:
|
||||||
j['entity'] = {}
|
j['entity'] = {}
|
||||||
elif l['type'] == 'event':
|
elif l['type'] == 'event':
|
||||||
qs = self.events.all()
|
qs = self.events.all()
|
||||||
|
|
Loading…
Reference in a new issue