From 5d9ecea552783ba513270bb0d79a357906747618 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Tue, 9 Dec 2003 00:35:13 +0000 Subject: [PATCH] Fixed bug in Poll.add, it didn't handle sqlite returning a string. --- plugins/Poll.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/Poll.py b/plugins/Poll.py index a6943efe0..540d452cd 100644 --- a/plugins/Poll.py +++ b/plugins/Poll.py @@ -206,7 +206,7 @@ class Poll(callbacks.Privmsg, plugins.ChannelDBHandler): cursor.execute("""SELECT COUNT(user_id) FROM votes WHERE poll_id=%s""", poll_id) - if cursor.fetchone()[0] != 0: + if int(cursor.fetchone()[0]) != 0: irc.error(msg, 'Cannot add options to a poll with votes.') return # Get the next highest id @@ -247,7 +247,7 @@ class Poll(callbacks.Privmsg, plugins.ChannelDBHandler): if cursor.rowcount == 0: irc.error(msg, 'There is no such poll.') return - elif cursor.fetchone()[0] == 0: + elif int(cursor.fetchone()[0]) == 0: irc.error(msg, 'That poll is closed.') return cursor.execute("""SELECT id FROM options