Polls: Make nick matching case-insensitive

This prevents the same nick from voting twice by changing
the capitalization
This commit is contained in:
Valentin Lorentz 2022-07-31 09:04:27 +02:00
parent 28c52c2818
commit cd0f9f2628
2 changed files with 9 additions and 1 deletions

View File

@ -149,7 +149,10 @@ class Poll_(callbacks.Plugin):
)
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)

View File

@ -73,6 +73,11 @@ class PollTestCase(ChannelPluginTestCase):
"voter1: Error: You already voted on this poll.",
frm="voter1!foo@bar",
)
self.assertResponse(
"vote 1 Yes",
"VOTER1: Error: You already voted on this poll.",
frm="VOTER1!foo@bar",
)
self.assertRegexp(
"results 1",