From f85a069eeccb62b8e70879dc96dacae11c839bce Mon Sep 17 00:00:00 2001 From: Daniel DiPaolo Date: Fri, 5 Dec 2003 03:55:28 +0000 Subject: [PATCH] Oops, the old logic for starting option ids at 1 was bogus. --- plugins/Poll.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/plugins/Poll.py b/plugins/Poll.py index 19ffab377..a6943efe0 100644 --- a/plugins/Poll.py +++ b/plugins/Poll.py @@ -213,10 +213,7 @@ class Poll(callbacks.Privmsg, plugins.ChannelDBHandler): cursor.execute("""SELECT MAX(id)+1 FROM options WHERE poll_id=%s""", poll_id) - if cursor.rowcount == 0: - option_id = 1 - else: - option_id = cursor.fetchone()[0] + option_id = cursor.fetchone()[0] or 1 cursor.execute("""INSERT INTO options VALUES (%s, %s, %s)""", option_id, poll_id, option)