From a430c6bdf47eeccae860eeccb3f9b64fc6267547 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 25 Sep 2015 14:44:02 +0100 Subject: [PATCH] make facets case insensitive --- pandora/item/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index 0b4798cf..2f1825e5 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -1078,7 +1078,9 @@ class Item(models.Model): if key in self.person_keys + ['name']: sortvalue = get_name_sort(value) sortvalue = utils.sort_string(sortvalue).lower()[:900] - Facet.objects.get_or_create(item=self, key=key, value=value, sortvalue=sortvalue) + f, created = Facet.objects.get_or_create(item=self, key=key, value=value, sortvalue=sortvalue) + if created: + Facet.objects.filter(key=key, value__iexact=value).exclude(value=value).update(value=value) saved_values.append(value.lower()) def update_facets(self):