From 0658976246343e42d3a52c2a3c2b079e0926668e Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Tue, 6 Jul 2021 17:24:57 +0200 Subject: [PATCH] Handle items with no label --- matcher/model.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/matcher/model.py b/matcher/model.py index 5671bb0..1280f2a 100644 --- a/matcher/model.py +++ b/matcher/model.py @@ -54,7 +54,9 @@ class Item(Base): return self.labels[lang]['value'] elif 'en' in self.labels: return self.labels['en']['value'] - return list(self.labels.values())[0]['value'] + + label_list = list(self.labels.values()) + return label_list[0]['value'] if label_list else '[no label]' def description(self, lang='en'): if lang in self.descriptions: