Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
Fixed a bug in previous next link generation due to draft posts' max …
Browse files Browse the repository at this point in the history
…time.
  • Loading branch information
Jai Sharma authored and Arachnid committed Jan 27, 2010
1 parent a676e11 commit 6336f24
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,12 @@ def get_prev_next(cls, post):
import models

q = models.BlogPost.all().order('-published')
q.filter('published !=', datetime.datetime.max)# Filter drafts out
q.filter('published <', post.published)
prev = q.fetch(1)

q = models.BlogPost.all().order('published')
q.filter('published !=', datetime.datetime.max)# Filter drafts out
q.filter('published >', post.published)
next = q.fetch(1)
if len(prev) > 0:
Expand Down

0 comments on commit 6336f24

Please sign in to comment.