1
1
Fork 0

Fixed post filtering when user not logged in

fixes
Jan Kužílek 5 years ago
parent 8a84622651
commit 3c322f73b3

@ -53,7 +53,7 @@ def posts(page):
if f_tags:
posts_query = posts_query.filter(Tag.content.in_(f_tags)).having(func.count(Post.id)==len(f_tags))
if current_user.is_anonymous or not current_user.is_moderator:
posts_query = posts_query.filter_by(status=POST_STATUS.active)
posts_query = posts_query.filter(Post.status==POST_STATUS.active)
posts_query = posts_query.filter(Post.rating.in_(m_ratings)).order_by(Post.created.desc())
posts = posts_query.paginate(page, current_app.config.get('POSTS_PER_PAGE'))

Loading…
Cancel
Save