Refactor blog category post selection

This commit is contained in:
str4d
2013-02-03 02:24:05 +00:00
parent 535e2f41b0
commit f32b6e3c14
2 changed files with 7 additions and 7 deletions

View File

@ -20,8 +20,7 @@ def blog_index(page):
@cache.memoize(600)
def blog_category(category, page):
posts = get_blog_posts()
category_posts = [(slug, post) for (slug, post) in posts if post['category'] and category in post['category']]
category_posts = get_blog_posts(category=category)
posts = get_for_page(category_posts, page, BLOG_POSTS_PER_PAGE)
if not posts and page != 1:
abort(404)