From c74997d49e09649ff296fff9e6095dddeb9c49ea Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Sat, 30 Nov 2024 14:26:22 +1300 Subject: [PATCH] only logged in can filter by Subscribed --- app/main/routes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/main/routes.py b/app/main/routes.py index 73432a91..96b8616c 100644 --- a/app/main/routes.py +++ b/app/main/routes.py @@ -91,7 +91,7 @@ def home_page(sort, view_filter): content_filters = user_filters_home(current_user.id) # view filter - subscribed/local/all - if view_filter == 'subscribed': + if view_filter == 'subscribed' and current_user.is_authenticated: 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': @@ -102,7 +102,7 @@ def home_page(sort, view_filter): posts = posts.filter(Community.show_popular == True, Post.score > 100) if current_user.is_anonymous: posts = posts.filter(Community.low_quality == False) - elif view_filter == 'all': + elif view_filter == 'all' or current_user.is_anonymous: posts = posts.join(Community, Community.id == Post.community_id) posts = posts.filter(Community.show_all == True)