From 07d52ae54e6ecdd1609c30fe51b14db9d641a96d Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Sun, 2 Jun 2024 19:09:57 +1200 Subject: [PATCH] soft deletes - home page #193 --- app/main/routes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/main/routes.py b/app/main/routes.py index a3251cda..2fa6943a 100644 --- a/app/main/routes.py +++ b/app/main/routes.py @@ -85,17 +85,17 @@ def home_page(type, sort): else: if type == 'home': posts = Post.query.join(CommunityMember, Post.community_id == CommunityMember.community_id).filter( - CommunityMember.is_banned == False) + CommunityMember.is_banned == False, Post.deleted == False) # posts = posts.join(User, CommunityMember.user_id == User.id).filter(User.id == current_user.id) posts = posts.filter(CommunityMember.user_id == current_user.id) elif type == 'popular': posts = Post.query.filter(Post.from_bot == False) posts = posts.join(Community, Community.id == Post.community_id) - posts = posts.filter(Community.show_popular == True, Post.score > 100) + posts = posts.filter(Community.show_popular == True, Post.score > 100, Post.deleted == False) elif type == 'all': posts = Post.query posts = posts.join(Community, Community.id == Post.community_id) - posts = posts.filter(Community.show_all == True) + posts = posts.filter(Community.show_all == True, Post.deleted == False) if current_user.ignore_bots: posts = posts.filter(Post.from_bot == False)