Skip to content
Permalink
Browse files
Post is scheduled only if not draft or private
Even if the date for a post is in the future, if it is marked as a draft
or a private post, it shouldn't be shown as a scheduled post since it's
not really going to be published when we cross that date.
  • Loading branch information
punchagan committed Jun 9, 2016
1 parent 6cf7744 commit 222cce71aec15c90389350be1b3097eedf7d9056
Showing 1 changed file with 4 additions and 1 deletion.
@@ -134,7 +134,10 @@ def _execute(self, options, args):
posts_drafts = sorted(posts_drafts, key=lambda post: post.source_path)

# find all scheduled posts with offset from now until publishing time
posts_scheduled = [(post.date - now, post) for post in self.site.all_posts if post.publish_later]
posts_scheduled = [
(post.date - now, post) for post in self.site.all_posts
if post.publish_later and not (post.is_draft or post.is_private)
]
posts_scheduled = sorted(posts_scheduled, key=lambda offset_post: (offset_post[0], offset_post[1].source_path))

if len(posts_scheduled) > 0:

0 comments on commit 222cce7

Please sign in to comment.