ignore case checking for existing entities, check for alternative names too, migrate existing double entries, fixes #2754
This commit is contained in:
parent
9d3c50fcec
commit
5b7b389661
3 changed files with 162 additions and 2 deletions
|
|
@ -115,7 +115,7 @@ class Entity(models.Model):
|
|||
data['name'] = "Unnamed"
|
||||
name = data['name']
|
||||
num = 1
|
||||
while Entity.objects.filter(name=name, type=self.type).exclude(id=self.id).count()>0:
|
||||
while Entity.objects.filter(name_find__icontains=u'|%s|'%name).exclude(id=self.id).count() > 0:
|
||||
num += 1
|
||||
name = data['name'] + ' [%d]' % num
|
||||
self.name = name
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue