Fixes index function to not index children without published version

This commit is contained in:
Dino Cikatic
2015-05-06 14:46:24 +02:00
parent 77d445c962
commit 21917461cf

View File

@@ -176,7 +176,8 @@ class SearchIndexerBase(object):
skip_child_index = skip_index or \
(triggered_at is not None and (triggered_at - item.subtree_edited_on) > reindex_age)
for child_item in item.get_children():
index_item(child_item, skip_index=skip_child_index)
if modulestore.has_published_version(child_item):
index_item(child_item, skip_index=skip_child_index)
if skip_index or not item_index_dictionary:
return