I think you want `enrollment.update_enrollment(mode=mode, is_active=True)` here.  The passed in `mode` is getting dropped on the floor.