From aafac3c1d861eee2529b1872c7a201d5bc57248d Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 12 Oct 2015 17:45:08 +0200 Subject: [PATCH] only store one item/key/value facet, remove facets with other case --- pandora/item/models.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora/item/models.py b/pandora/item/models.py index 2f1825e5f..284834dac 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -1080,6 +1080,7 @@ class Item(models.Model): sortvalue = utils.sort_string(sortvalue).lower()[:900] f, created = Facet.objects.get_or_create(item=self, key=key, value=value, sortvalue=sortvalue) if created: + Facet.objects.filter(item=self, key=key, value__iexact=value).exclude(value=value).delete() Facet.objects.filter(key=key, value__iexact=value).exclude(value=value).update(value=value) saved_values.append(value.lower())