From 3ae32db26e473448a5facfc5f689d50bb5f6cfb7 Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 19 Jun 2019 21:24:56 +0100 Subject: [PATCH] Don't let people vote in closed votes --- modules/vote.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/vote.py b/modules/vote.py index 3f2e1c03..a1beb522 100644 --- a/modules/vote.py +++ b/modules/vote.py @@ -109,6 +109,10 @@ class Module(ModuleManager.BaseModule): event["stdout"].write("Vote %s%s: %s" % ( vote_id, closed, self._format_vote(vote))) else: + if not vote["open"]: + raise utils.EventError("%s: vote %s is closed" % ( + event["user"].nickname, vote_id)) + choice = event["args_split"][1].lower() if not choice in vote["options"]: raise utils.EventError("Vote options: %s" %