Stop indexing when a node template doesn't return a value.

GitLab issue #391. Thanks to @jacekkow for the find and diagnostics.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2017-06-21 14:39:08 -04:00
parent ac9d72d451
commit c79b21e875
2 changed files with 28 additions and 7 deletions

View File

@@ -255,11 +255,11 @@ class IndexTemplateNode(MPTTModel):
if self.link_documents:
index_instance_node.documents.add(document)
for child in self.get_children():
child.index_document(
document=document, acquire_lock=False,
index_instance_node_parent=index_instance_node
)
for child in self.get_children():
child.index_document(
document=document, acquire_lock=False,
index_instance_node_parent=index_instance_node
)
finally:
if acquire_lock:
lock.release()