Oops, the old logic for starting option ids at 1 was bogus.

This commit is contained in:
Daniel DiPaolo 2003-12-05 03:55:28 +00:00
parent ef6e12ae90
commit f85a069eec

View File

@ -213,10 +213,7 @@ class Poll(callbacks.Privmsg, plugins.ChannelDBHandler):
cursor.execute("""SELECT MAX(id)+1 FROM options cursor.execute("""SELECT MAX(id)+1 FROM options
WHERE poll_id=%s""", WHERE poll_id=%s""",
poll_id) poll_id)
if cursor.rowcount == 0: option_id = cursor.fetchone()[0] or 1
option_id = 1
else:
option_id = cursor.fetchone()[0]
cursor.execute("""INSERT INTO options VALUES cursor.execute("""INSERT INTO options VALUES
(%s, %s, %s)""", (%s, %s, %s)""",
option_id, poll_id, option) option_id, poll_id, option)