forked from 0x2620/pandora
year might be none or int
This commit is contained in:
parent
234a5b67b9
commit
2093922208
1 changed files with 3 additions and 1 deletions
|
@ -1049,7 +1049,9 @@ class Item(models.Model):
|
|||
value = len(value)
|
||||
set_value(s, name, value)
|
||||
elif sort_type == 'year':
|
||||
value = self.get(source)[:4]
|
||||
value = self.get(source)
|
||||
if isinstance(value, str):
|
||||
value = value[:4]
|
||||
set_value(s, name, value)
|
||||
elif sort_type == 'date':
|
||||
value = value_ = self.get(source)
|
||||
|
|
Loading…
Reference in a new issue