'Apply the vote\'s effects and persist it.'

def commit(self):

    if (self.previous_vote and (self == self.previous_vote)):
        return
    self.apply_effects()
    VotesByAccount.write_vote(self)
    if ((self.thing.num_votes < 20) or ((self.thing.num_votes % 10) == 0)):
        self.thing.update_search_index(boost_only=True)
    if self.event_data:
        g.events.vote_event(self)
    g.stats.simple_event('vote.total')
