def add_master_course_staff_to_ccx_for_existing_ccx(apps, schema_editor):
 CustomCourseForEdX = apps.get_model(u'ccx', u'CustomCourseForEdX')
 list_ccx = CustomCourseForEdX.objects.all()
 for ccx in list_ccx:
  if ((not ccx.course_id) or ccx.course_id.deprecated):
   continue
  ccx_locator = CCXLocator.from_course_locator(ccx.course_id, unicode(ccx.id))
  try:
   course = get_course_by_id(ccx.course_id)
   add_master_course_staff_to_ccx(course, ccx_locator, ccx.display_name, send_email=False)
  except Http404:
   log.warning(u'Unable to add instructors and staff of master course %s to ccx %s.', ccx.course_id, ccx_locator)

def add_master_course_staff_to_ccx_for_existing_ccx ( apps , schema_editor ) : CustomCourseForEdX = apps . get_model ( u'ccx' , u'CustomCourseForEdX' ) list_ccx = CustomCourseForEdX . objects . all ( ) for ccx in list_ccx : if ( ( not ccx . course_id ) or ccx . course_id . deprecated ) : continue ccx_locator = CCXLocator . from_course_locator ( ccx . course_id , unicode ( ccx . id ) ) try : course = get_course_by_id ( ccx . course_id ) add_master_course_staff_to_ccx ( course , ccx_locator , ccx . display_name , send_email = False ) except Http404 : log . warning ( u'Unable to add instructors and staff of master course %s to ccx %s.' , ccx . course_id , ccx_locator )
add all staff and admin of master course to respective ccx(s) .