diff --git a/pandora/item/models.py b/pandora/item/models.py index f66e5f373..e5b6b05fb 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -848,7 +848,10 @@ class Item(models.Model): settings.CONFIG['itemKeys'])): current_values += self.get(k, []) if not isinstance(current_values, list): - current_values = [unicode(current_values)] + if not current_values: + current_values = [] + else: + current_values = [unicode(current_values)] current_values = list(set(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) diff --git a/pandora/person/models.py b/pandora/person/models.py index 4bfb882ca..114299568 100644 --- a/pandora/person/models.py +++ b/pandora/person/models.py @@ -102,7 +102,7 @@ class Person(models.Model): def update_sort_name(): for p in Person.objects.all(): - _sortname = ox.get_sort_name(p.name) + _sortname = ox.get_sort_name(p.name).lower() _sortname = unicodedata.normalize('NFKD', _sortname) if (not p.edited and _sortname != p.sortname) or \ (p.edited and _sortname == p.sortname):