The court had rejected the argument that legislators wear two hats, one as members of the original political party and another as members of the legislative party