mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 11:26:56 -08:00
only logged in can filter by Subscribed
This commit is contained in:
parent
7a7a1fe0d4
commit
c74997d49e
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue