mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
soft deletes - home page #193
This commit is contained in:
parent
2380a3ae61
commit
07d52ae54e
1 changed files with 3 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue