From a2c4bca2da86acd6556023eaee41545cd2c35f42 Mon Sep 17 00:00:00 2001 From: justcool393 Date: Sun, 20 Nov 2022 10:11:24 -0600 Subject: [PATCH] polls: don't allow bets on closed polls --- files/routes/polls.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/files/routes/polls.py b/files/routes/polls.py index dce8aa1a57..a0ec880cc5 100644 --- a/files/routes/polls.py +++ b/files/routes/polls.py @@ -20,6 +20,8 @@ def vote_option(option_id, v): abort(403, f"You need to be a member of House {sub.capitalize()} to vote on polls in /h/{sub}") if option.exclusive == 2: + if option.post.total_bet_voted: + abort(403, "You can't bet on a closed poll!") if not v.charge_account('coins', POLL_BET_COINS): abort(400, f"You don't have {POLL_BET_COINS} coins!") g.db.add(v)