mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-02-02 16:21:32 -08:00
home page - only show posts from some communities
This commit is contained in:
parent
88702bb9f2
commit
69a1f6316e
1 changed files with 1 additions and 0 deletions
|
@ -37,6 +37,7 @@ def index():
|
|||
if current_user.is_anonymous:
|
||||
flash(_('Create an account to tailor this feed to your interests.'))
|
||||
posts = Post.query.filter(Post.from_bot == False, Post.nsfw == False, Post.nsfl == False)
|
||||
posts = posts.join(Community, Community.id == Post.community_id).filter(Community.show_home == True)
|
||||
else:
|
||||
posts = Post.query.join(CommunityMember, Post.community_id == CommunityMember.community_id).filter(CommunityMember.is_banned == False)
|
||||
posts = posts.join(User, CommunityMember.user_id == User.id).filter(User.id == current_user.id)
|
||||
|
|
Loading…
Add table
Reference in a new issue