diff --git a/pandora/annotation/models.py b/pandora/annotation/models.py index 64bf7455b..24446ca92 100644 --- a/pandora/annotation/models.py +++ b/pandora/annotation/models.py @@ -226,10 +226,10 @@ class Annotation(models.Model): j['languages'] = self.languages.split(',') l = self.get_layer() if l['type'] == 'entity': - entity = Entity.get_by_name(self.value) - if entity > 0: + try: + entity = Entity.get(self.value) j['entity'] = entity.json(user=user) - else: + except: j['entity'] = {} elif l['type'] == 'event': qs = self.events.all()