Change the users karma by the karma amount (either 1 or -1)

def update_db(self, userkarma, username):
        """
        Change the users karma by the karma amount (either 1 or -1)
        """

        kt = self.db.session.query(KarmaTable)
        for user in userkarma:
            if user != username:
                # Modify the db accourdingly
                urow = kt.filter(KarmaTable.user == ude(user)).first()
                # If the user doesn't exist, create it
                if not urow:
                    urow = KarmaTable(ude(user))
                urow.kcount += userkarma[user]
                self.db.session.add(urow)
        self.db.session.commit()