diff --git a/files/classes/submission.py b/files/classes/submission.py index e3b544196..45370198f 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -366,12 +366,12 @@ class Submission(Base): if o.exclusive > 1: body += f'''
= 200) or self.total_bet_voted(v): body += " disabled " + if not (v and v.coins >= POLL_BET_COINS) or self.total_bet_voted(v): body += " disabled " body += f'''>" if o.exclusive == 3: diff --git a/files/helpers/const.py b/files/helpers/const.py index 01d34b05c..a665a9b89 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -193,6 +193,7 @@ DONGER_ID = 0 GEESE_ID = 0 POLL_THREAD = 0 +POLL_BET_COINS = 200 WELCOME_MSG = f"Welcome to {SITE_NAME}!" ROLES={} diff --git a/files/routes/admin.py b/files/routes/admin.py index 722a0fe79..53d4ab58c 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -213,7 +213,7 @@ def distribute(v, option_id): pool = 0 for o in post.options: if o.exclusive >= 2: pool += o.upvotes - pool *= 200 + pool *= POLL_BET_COINS autojanny.coins -= pool if autojanny.coins < 0: autojanny.coins = 0 @@ -229,7 +229,7 @@ def distribute(v, option_id): add_notif(cid, u.id) - cid = notif_comment(f"You lost the 200 coins you bet on [{post.title}]({post.shortlink}) :marseylaugh:") + cid = notif_comment(f"You lost the {POLL_BET_COINS} coins you bet on [{post.title}]({post.shortlink}) :marseylaugh:") losing_voters = [] for o in post.options: if o.exclusive == 2: diff --git a/files/routes/polls.py b/files/routes/polls.py index af2245834..b75cfc68b 100644 --- a/files/routes/polls.py +++ b/files/routes/polls.py @@ -22,11 +22,11 @@ def vote_option(option_id, v): return {"error": f"You need to be a member of House {sub.capitalize()} to vote on polls in /h/{sub}"}, 400 if option.exclusive == 2: - if v.coins < 200: return {"error": "You don't have 200 coins!"}, 400 - v.coins -= 200 + if v.coins < POLL_BET_COINS: return {"error": f"You don't have {POLL_BET_COINS} coins!"}, 400 + v.coins -= POLL_BET_COINS g.db.add(v) autojanny = get_account(AUTOJANNY_ID) - autojanny.coins += 200 + autojanny.coins += POLL_BET_COINS g.db.add(autojanny) if option.exclusive: