From 2dc7bd30691a50b2da9c2833ba354056bc686afa Mon Sep 17 00:00:00 2001 From: Istvan Albert Date: Thu, 6 Jan 2022 22:19:23 -0500 Subject: [PATCH] spam cleanup deletes posts not users --- biostar/tools/cleanup/spam.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/biostar/tools/cleanup/spam.py b/biostar/tools/cleanup/spam.py index 9f36c0676..8296e7bfe 100644 --- a/biostar/tools/cleanup/spam.py +++ b/biostar/tools/cleanup/spam.py @@ -57,7 +57,7 @@ def main(apply=False, days=7, limit=10, verbose=False): text = f"spammer: user={user.profile.name}, spam_count={spam_count}" logger.info(text) if apply: - user.delete() + posts.filter(spam=Post.SPAM).delete() if apply and delete_count: msg = f"spam cleanup, removed {user_count} spammers and {delete_count} spam posts"