def _is_enrollment_code_an_update(course, user, redemption_code):
 (enrollment_mode, is_active) = CourseEnrollment.enrollment_mode_for_user(user, course.id)
 return ((not is_active) or (enrollment_mode != redemption_code.mode_slug))

def _is_enrollment_code_an_update ( course , user , redemption_code ) : ( enrollment_mode , is_active ) = CourseEnrollment . enrollment_mode_for_user ( user , course . id ) return ( ( not is_active ) or ( enrollment_mode != redemption_code . mode_slug ) )
checks to see if the users enrollment can be updated by the code .