From 83393ee385a474215aa622236e178c4f03e37e50 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 3 Feb 2015 18:44:05 +0100 Subject: [PATCH] name must be unicode --- pandora/entity/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandora/entity/models.py b/pandora/entity/models.py index 24c6038ec..6e8ae8286 100644 --- a/pandora/entity/models.py +++ b/pandora/entity/models.py @@ -46,6 +46,8 @@ class Entity(models.Model): def save(self, *args, **kwargs): entity = get_by_id(settings.CONFIG['entities'], self.type) if entity.get('sortType') == 'person' and self.name: + if isinstance(self.name, str): + self.name = self.name.decode('utf-8') self.name_sort = get_name_sort(self.name)[:255].lower() else: self.name_sort = ox.sort_string(self.name or u'')[:255].lower() or None