Man charged with buying gun for Rittenhouse takes plea deal