refactor: de-index courses in contentstore, not course_overviews
This is a minor refactoring in order to remove a code dependency of ./opendedx on ./cms
This commit is contained in:
committed by
Kyle McCormick
parent
1d1a6b29a6
commit
709db42835
@@ -70,6 +70,15 @@ def listen_for_course_publish(sender, course_key, **kwargs): # pylint: disable=
|
||||
update_search_index.delay(course_key_str, datetime.now(UTC).isoformat())
|
||||
|
||||
|
||||
@receiver(SignalHandler.course_deleted)
|
||||
def listen_for_course_delete(sender, course_key, **kwargs): # pylint: disable=unused-argument
|
||||
"""
|
||||
Catches the signal that a course has been deleted
|
||||
and removes its entry from the Course About Search index.
|
||||
"""
|
||||
CourseAboutSearchIndexer.remove_deleted_items(course_key)
|
||||
|
||||
|
||||
@receiver(SignalHandler.library_updated)
|
||||
def listen_for_library_update(sender, library_key, **kwargs): # pylint: disable=unused-argument
|
||||
"""
|
||||
|
||||
@@ -41,10 +41,6 @@ def _listen_for_course_delete(sender, course_key, **kwargs): # pylint: disable=
|
||||
invalidates the corresponding CourseOverview cache entry if one exists.
|
||||
"""
|
||||
CourseOverview.objects.filter(id=course_key).delete()
|
||||
# import CourseAboutSearchIndexer inline due to cyclic import
|
||||
from cms.djangoapps.contentstore.courseware_index import CourseAboutSearchIndexer
|
||||
# Delete course entry from Course About Search_index
|
||||
CourseAboutSearchIndexer.remove_deleted_items(course_key)
|
||||
|
||||
|
||||
def _check_for_course_changes(previous_course_overview, updated_course_overview):
|
||||
|
||||
Reference in New Issue
Block a user