do not fail on related docs where there are no associated docs (#1122)

This commit is contained in:
Frédéric Péters 2011-12-06 21:45:02 +01:00
parent 960e52d621
commit 3c7c454538
1 changed files with 1 additions and 1 deletions

View File

@ -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