|
|
@ -53,7 +53,7 @@ def posts(page):
|
|
|
|
if f_tags:
|
|
|
|
if f_tags:
|
|
|
|
posts_query = posts_query.filter(Tag.content.in_(f_tags)).having(func.count(Post.id)==len(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:
|
|
|
|
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_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'))
|
|
|
|
posts = posts_query.paginate(page, current_app.config.get('POSTS_PER_PAGE'))
|
|
|
|