Section 27. No mayor or member of the city council or school committee and no officer or employee of the city shall directly or indirectly make a contract with the city, or receive any commission, discount, bonus, gift, contribution, or reward from or any share in the profits of any person making or performing such contract, unless the mayor, such member, officer or employee, immediately upon learning of the existence of such contract, or that such contract is proposed, shall notify in writing the mayor, city council or school committee of the nature of his interest in such contract, and shall abstain from doing any official act on behalf of the city in reference thereto. In case of such interest on the part of an officer whose duty it is to sign such contract on behalf of the city, the contract may be signed by any other officer of the city duly authorized thereto by the mayor, or if the mayor has such interest, by the city clerk; provided, that when a contractor with the city is a corporation or a voluntary stock association, the ownership of less than five per cent of the stock or shares actually issued shall not be considered as involving an interest in the contract within the meaning of this section, and such ownership shall not affect the validity of the contract unless the owner of such stock or shares is also an officer or agent of the corporation or association, or solicits or takes part in the making of the contract.
A violation of any provision of this section shall render the contract in respect to which such violation occurs voidable at the option of the city. Any person violating the provisions of this section shall be punished by a fine of not more than one thousand dollars, or by imprisonment for not more than one year, or both.