do not fail on related docs where there are no associated docs (#1122)
This commit is contained in:
parent
960e52d621
commit
3c7c454538
|
@ -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
|
||||
|
|
Reference in New Issue