don't count as trash if it's only one downvote or score is >=10

This commit is contained in:
Hendrik L 2024-12-28 11:11:59 +01:00
parent d9eb3939b8
commit e7b64554c1

View file

@ -1206,11 +1206,11 @@ def admin_content():
post_replies = PostReply.query.join(User, User.id == PostReply.user_id).filter(PostReply.deleted == False) post_replies = PostReply.query.join(User, User.id == PostReply.user_id).filter(PostReply.deleted == False)
if show == 'trash': if show == 'trash':
title = _('Bad / Most downvoted') title = _('Bad / Most downvoted')
posts = posts.filter(Post.down_votes > 0) posts = posts.filter(Post.down_votes > 1, Post.score < 10)
if days > 0: if days > 0:
posts = posts.filter(Post.posted_at > utcnow() - timedelta(days=days)) posts = posts.filter(Post.posted_at > utcnow() - timedelta(days=days))
posts = posts.order_by(Post.score) posts = posts.order_by(Post.score)
post_replies = post_replies.filter(PostReply.down_votes > 0) post_replies = post_replies.filter(PostReply.down_votes > 1, PostReply.score < 10)
if days > 0: if days > 0:
post_replies = post_replies.filter(PostReply.posted_at > utcnow() - timedelta(days=days)) post_replies = post_replies.filter(PostReply.posted_at > utcnow() - timedelta(days=days))
post_replies = post_replies.order_by(PostReply.score) post_replies = post_replies.order_by(PostReply.score)