disallow ALL bots from voting

master
Aevann 2023-07-08 02:18:03 +03:00
parent cce4f2346c
commit 517ed8a9d3
3 changed files with 7 additions and 4 deletions

View File

@ -686,7 +686,7 @@ HOLE_COST = 0
GROUP_COST = 10000
HOLE_INACTIVITY_DELETION = False
PRIVILEGED_USER_BOTS = ()
BOT_SYMBOL_HIDDEN = ()
AUTOJANNY_ID = 1
SNAPPY_ID = 2
@ -810,7 +810,7 @@ if SITE == 'rdrama.net':
HOLE_COST = 50000
HOLE_INACTIVITY_DELETION = True
PRIVILEGED_USER_BOTS = (12125,16049)
BOT_SYMBOL_HIDDEN = (12125,16049)
EXEMPT_FROM_1WEEK_EDITING_LIMIT = {1048}
AUTOJANNY_ID = 1046

View File

@ -264,7 +264,7 @@ def comment(v:User):
if len(body_html) > COMMENT_BODY_HTML_LENGTH_LIMIT:
abort(400, "Comment too long!")
is_bot = v.client is not None and v.id not in PRIVILEGED_USER_BOTS
is_bot = v.client is not None and v.id not in BOT_SYMBOL_HIDDEN
chudded = v.chud and not (posting_to_post and post_target.sub == 'chudrama')

View File

@ -53,7 +53,10 @@ def vote_info_get(v, link):
def vote_post_comment(target_id, new, v, cls, vote_cls):
if new == "-1" and DISABLE_DOWNVOTES: abort(403)
if new not in {"-1", "0", "1"}: abort(400)
if v.client and v.id not in PRIVILEGED_USER_BOTS: abort(403)
if request.headers.get("Authorization"):
abort(403, "Bots aren't allowed to vote right now")
new = int(new)
target = None
if cls == Post: