def remove_course_milestones(course_key, user, relationship):
 if (not settings.FEATURES.get('MILESTONES_APP')):
  return None
 course_milestones = milestones_api.get_course_milestones(course_key=course_key, relationship=relationship)
 for milestone in course_milestones:
  milestones_api.remove_user_milestone({'id': user.id}, milestone)

def remove_course_milestones ( course_key , user , relationship ) : if ( not settings . FEATURES . get ( 'MILESTONES_APP' ) ) : return None course_milestones = milestones_api . get_course_milestones ( course_key = course_key , relationship = relationship ) for milestone in course_milestones : milestones_api . remove_user_milestone ( { 'id' : user . id } , milestone )
remove all user milestones for the course specified by course_key .