The city of Portland's code includes a requirement that the winner of the mayor's race get a majority of votes.

Here's what the code says (emphasis added):

"If no candidate receives a majority of the votes cast for the office at the Primary Election, the two candidates receiving the highest number of votes for that office shall appear on the General Election ballot. The candidate receiving the majority of votes cast at the General Election shall be elected."

Incumbent Mayor Ted Wheeler did not receive a majority in the primary and although he finished 25 percentage points ahead of second-place finisher Sarah Iannarone, two recent polls—one showing Iannarone ahead by 11 points and a more recent one showing the race is even—suggest the general election result will be very close.

The final result could be affected by supporters of Teressa Raiford, founder of Don't Shoot Portland, who finished third in the May primary, getting more than 8% of the vote.

The two recent polls showed a large percentage of voters uncommitted to the two candidates on the ballot, and Raiford's supporters are actively pushing on social media, on utility poles and through a petition for voters to write her in.

So what happens if that campaign prevents either of the two candidates on the ballot from getting 50% plus one vote?

City elections officer Deborah Scroggin says her office has fielded a number of inquiries about the code language.

"It's true that a straight reading of this code section can be confusing, and we do intend to clarify it in the future given the number of inquiries we've received this elections cycle," Scroggin said in an email. "However, the charter prevails here. Portland City Charter Section 3-101 requires a candidate in a November runoff to receive the highest number of votes in order to win."

Here's what the charter says (emphasis added):

"If no candidate for such an office receives a majority of the votes cast in the primary election, the names of the two candidates receiving the highest number of votes cast shall be declared nominees and their names shall appear on the general election ballot in that same year. The nominee receiving the highest number of votes in the general election shall be elected."

In other words, the charter trumps city code, resolving the matter.