fall back to empty string

This commit is contained in:
j 2021-09-16 18:49:38 +02:00
parent 8a16c7e37f
commit fd318ef706

View file

@ -1019,10 +1019,14 @@ class Item(models.Model):
set_value(s, name, value) set_value(s, name, value)
elif sort_type == 'person': elif sort_type == 'person':
value = sortNames(self.get(source, [])) value = sortNames(self.get(source, []))
if value is None:
value = ''
value = utils.sort_string(value)[:955] value = utils.sort_string(value)[:955]
set_value(s, name, value) set_value(s, name, value)
elif sort_type == 'string': elif sort_type == 'string':
value = self.get(source, '') value = self.get(source, '')
if value is None:
value = ''
if isinstance(value, list): if isinstance(value, list):
value = ','.join([str(v) for v in value]) value = ','.join([str(v) for v in value])
value = utils.sort_string(value)[:955] value = utils.sort_string(value)[:955]