From 3c7c4545387294a1ced36a4175b47517b79dd742 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Tue, 6 Dec 2011 21:45:02 +0100 Subject: [PATCH] do not fail on related docs where there are no associated docs (#1122) --- tabellio/documents/document.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tabellio/documents/document.py b/tabellio/documents/document.py index 1f7f224..4bb80da 100644 --- a/tabellio/documents/document.py +++ b/tabellio/documents/document.py @@ -104,7 +104,7 @@ class Document(Item, BasePublication): def related_elements(self, max_items=5, closeness=0.5): r = BasePublication.related_elements(self, max_items, closeness) - doc_ids = [x.id for x in self.associated_docs] + doc_ids = [x.id for x in (self.associated_docs or [])] return [x for x in r if ((type(x.getId) is str) and x.getId or x.getId()) not in doc_ids] @property