No officer or employee of the city, other than the mayor and councilmen, shall continue in the employment of the city after becoming a candidate for nomination or election to any city or other public office.