def create_manual_course_enrollment(user, course_id, mode, enrolled_by, reason, state_transition):
 enrollment_obj = CourseEnrollment.enroll(user, course_id, mode=mode)
 ManualEnrollmentAudit.create_manual_enrollment_audit(enrolled_by, user.email, state_transition, reason, enrollment_obj)
 log.info(u'user %s enrolled in the course %s', user.username, course_id)
 return enrollment_obj

def create_manual_course_enrollment ( user , course_id , mode , enrolled_by , reason , state_transition ) : enrollment_obj = CourseEnrollment . enroll ( user , course_id , mode = mode ) ManualEnrollmentAudit . create_manual_enrollment_audit ( enrolled_by , user . email , state_transition , reason , enrollment_obj ) log . info ( u'user %s enrolled in the course %s' , user . username , course_id ) return enrollment_obj
create course enrollment for the given student and create manual enrollment audit trail .