Merge pull request #7945 from edx/dcikatic/index_unpublished_fix

Fixes index function to not index children without published version - Thank you @dino-cikatic!
This commit is contained in:
Martyn James
2015-05-06 10:38:02 -04:00

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