mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-04 16:44:11 +01:00
Polls: Make nick matching case-insensitive
This prevents the same nick from voting twice by changing the capitalization
This commit is contained in:
parent
28c52c2818
commit
cd0f9f2628
@ -149,7 +149,10 @@ class Poll_(callbacks.Plugin):
|
|||||||
)
|
)
|
||||||
|
|
||||||
self._polls[(irc.network, channel)][poll_id] = Poll(
|
self._polls[(irc.network, channel)][poll_id] = Poll(
|
||||||
question=question, answers=dict(answers), votes={}, open=True
|
question=question,
|
||||||
|
answers=dict(answers),
|
||||||
|
votes=ircutils.IrcDict(),
|
||||||
|
open=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
irc.replySuccess(_("Poll # %d created.") % poll_id)
|
irc.replySuccess(_("Poll # %d created.") % poll_id)
|
||||||
|
@ -73,6 +73,11 @@ class PollTestCase(ChannelPluginTestCase):
|
|||||||
"voter1: Error: You already voted on this poll.",
|
"voter1: Error: You already voted on this poll.",
|
||||||
frm="voter1!foo@bar",
|
frm="voter1!foo@bar",
|
||||||
)
|
)
|
||||||
|
self.assertResponse(
|
||||||
|
"vote 1 Yes",
|
||||||
|
"VOTER1: Error: You already voted on this poll.",
|
||||||
|
frm="VOTER1!foo@bar",
|
||||||
|
)
|
||||||
|
|
||||||
self.assertRegexp(
|
self.assertRegexp(
|
||||||
"results 1",
|
"results 1",
|
||||||
|
Loading…
Reference in New Issue
Block a user