From 45c84e79d91451273f4ae742a7861e6839b9bb82 Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Fri, 16 Aug 2024 13:50:59 +1200 Subject: [PATCH] refactor home page based on #293 local posts are those in local communities, not those posted anywhere by local accounts --- app/main/routes.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/main/routes.py b/app/main/routes.py index 9ec51514..0b144dc8 100644 --- a/app/main/routes.py +++ b/app/main/routes.py @@ -98,7 +98,8 @@ def home_page(sort, view_filter): posts = posts.join(CommunityMember, Post.community_id == CommunityMember.community_id).filter(CommunityMember.is_banned == False) posts = posts.filter(CommunityMember.user_id == current_user.id) elif view_filter == 'local': - posts = posts.filter(Post.instance_id == 1) + posts = posts.join(Community, Community.id == Post.community_id) + posts = posts.filter(Community.instance_id == 1) elif view_filter == 'popular': posts = posts.join(Community, Community.id == Post.community_id) posts = posts.filter(Community.show_popular == True, Post.score > 100)