forked from 0x2620/pandora
don't decode str
This commit is contained in:
parent
1a3edf4f93
commit
88d47eba6b
1 changed files with 1 additions and 1 deletions
|
@ -54,7 +54,7 @@ class Entity(models.Model):
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
entity = get_by_id(settings.CONFIG['entities'], self.type)
|
entity = get_by_id(settings.CONFIG['entities'], self.type)
|
||||||
if entity.get('sortType') == 'person' and self.name:
|
if entity.get('sortType') == 'person' and self.name:
|
||||||
if isinstance(self.name, str):
|
if isinstance(self.name, bytes):
|
||||||
self.name = self.name.decode('utf-8')
|
self.name = self.name.decode('utf-8')
|
||||||
self.name_sort = get_name_sort(self.name)[:255].lower()
|
self.name_sort = get_name_sort(self.name)[:255].lower()
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue