Skip to content
This repository was archived by the owner on Mar 7, 2018. It is now read-only.

"Fresh Posts" feature #42

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix bug in fresh posts commit
The last post from the regular feed should only be hidden/removed if there is (and it is) a fresh post.
jmonegro committed Apr 22, 2014
commit 0f1f9377fe5a4e9f9ac54617fcd326882c0b58ec
3 changes: 2 additions & 1 deletion app/posts.py
Original file line number Diff line number Diff line change
@@ -146,7 +146,8 @@ def get(self, day="today", page=1, sort_by="hot"):
fresh_posts = postsdb.get_fresh_posts(hours=1, quantity=1)

hot_posts = postsdb.get_hot_posts_by_day(day)
hot_posts.pop(-1)
if fresh_posts:
hot_posts.pop(-1)

posts = fresh_posts + hot_posts
else: