mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +01:00
Fixed bug in Poll.add, it didn't handle sqlite returning a string.
This commit is contained in:
parent
60797f770d
commit
5d9ecea552
@ -206,7 +206,7 @@ class Poll(callbacks.Privmsg, plugins.ChannelDBHandler):
|
|||||||
cursor.execute("""SELECT COUNT(user_id) FROM votes
|
cursor.execute("""SELECT COUNT(user_id) FROM votes
|
||||||
WHERE poll_id=%s""",
|
WHERE poll_id=%s""",
|
||||||
poll_id)
|
poll_id)
|
||||||
if cursor.fetchone()[0] != 0:
|
if int(cursor.fetchone()[0]) != 0:
|
||||||
irc.error(msg, 'Cannot add options to a poll with votes.')
|
irc.error(msg, 'Cannot add options to a poll with votes.')
|
||||||
return
|
return
|
||||||
# Get the next highest id
|
# Get the next highest id
|
||||||
@ -247,7 +247,7 @@ class Poll(callbacks.Privmsg, plugins.ChannelDBHandler):
|
|||||||
if cursor.rowcount == 0:
|
if cursor.rowcount == 0:
|
||||||
irc.error(msg, 'There is no such poll.')
|
irc.error(msg, 'There is no such poll.')
|
||||||
return
|
return
|
||||||
elif cursor.fetchone()[0] == 0:
|
elif int(cursor.fetchone()[0]) == 0:
|
||||||
irc.error(msg, 'That poll is closed.')
|
irc.error(msg, 'That poll is closed.')
|
||||||
return
|
return
|
||||||
cursor.execute("""SELECT id FROM options
|
cursor.execute("""SELECT id FROM options
|
||||||
|
Loading…
Reference in New Issue
Block a user