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