From c795afa3dabd6d89fbc19ec9b7aa8635d52b35d5 Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Thu, 23 Apr 2015 11:08:26 +0100 Subject: [PATCH] Entity: ignore case when uniquifying name --- 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 9815e82..f27343b 100644 --- a/pandora/entity/models.py +++ b/pandora/entity/models.py @@ -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__iexact=name, type=self.type).exclude(id=self.id).count()>0: num += 1 name = data['name'] + ' [%d]' % num self.name = name -- 2.1.0