From 876933afe12143012305fd836692586b1b8ce2ed Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 12 Dec 2021 19:45:59 +0200 Subject: [PATCH 2/3] sfdsdf --- files/routes/votes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/routes/votes.py b/files/routes/votes.py index f49d72ab7..6ef50a9fc 100644 --- a/files/routes/votes.py +++ b/files/routes/votes.py @@ -69,7 +69,7 @@ def admin_vote_info_get(v): @validate_formkey def api_vote_post(post_id, new, v): - if v.is_banned and not v.unban_utc: return {"error": "forbidden."}, 403 + if v.is_banned and not v.unban_utc or new == "-1" and environ.get('DISABLE_DOWNVOTES') == '1': return {"error": "forbidden."}, 403 if new not in ["-1", "0", "1"]: abort(400) @@ -132,7 +132,7 @@ def api_vote_post(post_id, new, v): @validate_formkey def api_vote_comment(comment_id, new, v): - if v.is_banned and not v.unban_utc: return {"error": "forbidden."}, 403 + if v.is_banned and not v.unban_utc or new == "-1" and environ.get('DISABLE_DOWNVOTES') == '1': return {"error": "forbidden."}, 403 if new not in ["-1", "0", "1"]: abort(400)