From 35644ac048008feedfb6030c71b4f5b229e43534 Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Thu, 14 May 2015 17:10:38 +0100 Subject: [PATCH 1/2] Entity: fix name_find when alternativeNames is non-empty Previously, given: name = "foo" alternativeNames = ("bar", "baz") then: name_find = '||foobar||baz||' --- pandora/entity/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora/entity/models.py b/pandora/entity/models.py index 52a4da9..8a5bfa1 100644 --- a/pandora/entity/models.py +++ b/pandora/entity/models.py @@ -55,7 +55,7 @@ class Entity(models.Model): self.name_sort = get_name_sort(self.name)[:255].lower() else: self.name_sort = ox.sort_string(self.name or u'')[:255].lower() or None - self.name_find = '||' + self.name + '||'.join(self.alternativeNames) + '||' + self.name_find = '||' + '||'.join((self.name,) + self.alternativeNames) + '||' super(Entity, self).save(*args, **kwargs) self.update_matches() self.update_annotations() -- 2.1.0