@receiver(SignalHandler.course_published)
def listen_for_course_publish(sender, course_key, **kwargs):
 from .tasks import update_course_structure
 try:
  structure = CourseStructure.objects.get(course_id=course_key)
  structure.discussion_id_map_json = None
  structure.save()
 except CourseStructure.DoesNotExist:
  pass
 update_course_structure.apply_async([unicode(course_key)], countdown=0)

@ receiver ( SignalHandler . course_published ) def listen_for_course_publish ( sender , course_key , ** kwargs ) : from . tasks import update_course_structure try : structure = CourseStructure . objects . get ( course_id = course_key ) structure . discussion_id_map_json = None structure . save ( ) except CourseStructure . DoesNotExist : pass update_course_structure . apply_async ( [ unicode ( course_key ) ] , countdown = 0 )
receives publishing signal and performs publishing related workflows .