From 82a092eec835d4b44496cad5a4fc4fda46f2606f Mon Sep 17 00:00:00 2001 From: freamon Date: Wed, 20 Mar 2024 10:50:42 +0000 Subject: [PATCH] Also prevent bot accounts from voting --- app/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/utils.py b/app/utils.py index 4fbcd545..dd1d64cc 100644 --- a/app/utils.py +++ b/app/utils.py @@ -442,7 +442,7 @@ def banned_ip_addresses() -> List[str]: def can_downvote(user, community: Community, site=None) -> bool: - if user is None or community is None or user.banned: + if user is None or community is None or user.banned or user.bot: return False if site is None: @@ -464,7 +464,7 @@ def can_downvote(user, community: Community, site=None) -> bool: def can_upvote(user, community: Community) -> bool: - if user is None or community is None or user.banned: + if user is None or community is None or user.banned or user.bot: return False return True