mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-07 19:49:23 +01:00
Oops, the old logic for starting option ids at 1 was bogus.
This commit is contained in:
parent
ef6e12ae90
commit
f85a069eec
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user