forked from 0x2620/pandora
Entity: fix name_find when alternativeNames is non-empty
Previously, given: name = "foo" alternativeNames = ("bar", "baz") then: name_find = '||foobar||baz||'
This commit is contained in:
parent
b7a83554ab
commit
fe7f961ff6
1 changed files with 1 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue