From 8cddcb0c9aeea88afb1b88f2e337a9aa78fb6064 Mon Sep 17 00:00:00 2001 From: Russel Neiss Date: Fri, 25 Mar 2022 17:35:49 -0500 Subject: [PATCH] modify spam algorithm to catch prolific spammers who check their work. (take 2) --- sefaria/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sefaria/views.py b/sefaria/views.py index 5c5697336a..a6a4a57ab8 100644 --- a/sefaria/views.py +++ b/sefaria/views.py @@ -874,7 +874,7 @@ def profile_spam_dashboard(request): {'website': {"$ne": ""}, 'bio': {"$ne": ""}, "id": {"$gt": earliest_new_user_id}, "reviewed": {"$ne": True}}, {'bio': {"$regex": regex}, "id": {"$gt": earliest_new_user_id}, "reviewed": {"$ne": True}}, - {'slug': {"$regex": spam_keywords_regex}, "id": {"$gt": earliest_new_user_id}, "reviewed": {"$ne": True}, "book": {"$ne": "Sheet"}} + {'slug': {"$regex": spam_keywords_regex}, "id": {"$gt": earliest_new_user_id}, "reviewed": {"$ne": True}} ] }) @@ -883,7 +883,7 @@ def profile_spam_dashboard(request): profiles_list = [] for user in users_to_check: - history_count = db.user_history.find({'uid': user['id']}).count() + history_count = db.user_history.find({'uid': user['id'], 'book': {'$ne': 'Sheet'}}).count() if history_count < 10: profile = model.user_profile.UserProfile(id=user["id"])