def fulfill_course_milestone(course_key, user):
 if (not settings.FEATURES.get('MILESTONES_APP')):
  return None
 try:
  course_milestones = milestones_api.get_course_milestones(course_key=course_key, relationship='fulfills')
 except InvalidMilestoneRelationshipTypeException:
  seed_milestone_relationship_types()
  course_milestones = milestones_api.get_course_milestones(course_key=course_key, relationship='fulfills')
 for milestone in course_milestones:
  milestones_api.add_user_milestone({'id': user.id}, milestone)

def fulfill_course_milestone ( course_key , user ) : if ( not settings . FEATURES . get ( 'MILESTONES_APP' ) ) : return None try : course_milestones = milestones_api . get_course_milestones ( course_key = course_key , relationship = 'fulfills' ) except InvalidMilestoneRelationshipTypeException : seed_milestone_relationship_types ( ) course_milestones = milestones_api . get_course_milestones ( course_key = course_key , relationship = 'fulfills' ) for milestone in course_milestones : milestones_api . add_user_milestone ( { 'id' : user . id } , milestone )
marks the course specified by the given course_key as complete for the given user .