From ef44a4f2137b66f3be9187e274710f987bcd0e50 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 28 Oct 2014 11:27:57 +0000 Subject: [PATCH] filters values can only be strings. strip tags --- pandora/item/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index 80a779f5a..376d7d5d3 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -1000,7 +1000,7 @@ class Item(models.Model): def update_layer_facet(self, key): current_values = [a['value'] for a in self.annotations.filter(layer=key).distinct().values('value')] - current_values = [ox.decode_html(v) for v in current_values] + current_values = [ox.decode_html(ox.strip_tags(v)) for v in current_values] saved_values = [i.value for i in Facet.objects.filter(item=self, key=key)] removed_values = filter(lambda i: i not in current_values, saved_values) if removed_values: @@ -1049,7 +1049,7 @@ class Item(models.Model): else: current_values = [unicode(current_values)] current_values = list(set(current_values)) - current_values = [ox.decode_html(v) for v in current_values] + current_values = [ox.decode_html(ox.strip_tags(v)) for v in current_values] saved_values = [i.value for i in Facet.objects.filter(item=self, key=key)] removed_values = filter(lambda i: i not in current_values, saved_values) if removed_values: