@receiver(SignalHandler.course_deleted)
def _listen_for_course_delete(sender, course_key, **kwargs):
 CourseOverview.objects.filter(id=course_key).delete()
 from cms.djangoapps.contentstore.courseware_index import CourseAboutSearchIndexer
 CourseAboutSearchIndexer.remove_deleted_items(course_key)

@ receiver ( SignalHandler . course_deleted ) def _listen_for_course_delete ( sender , course_key , ** kwargs ) : CourseOverview . objects . filter ( id = course_key ) . delete ( ) from cms . djangoapps . contentstore . courseware_index import CourseAboutSearchIndexer CourseAboutSearchIndexer . remove_deleted_items ( course_key )
catches the signal that a course has been deleted from the module store and invalidates the corresponding cache entry if one exists .