From 2093922208d06e90c4bd9af89b93834fd245d917 Mon Sep 17 00:00:00 2001 From: j Date: Sun, 8 Dec 2019 21:19:23 +0000 Subject: [PATCH] year might be none or int --- pandora/item/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index 695558c3..b9dd78ee 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -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)