Created
December 12, 2014 03:25
-
-
Save robclancy/3b2dfab4237883a3dd51 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 196194b9787a1f9fd95d6165a967f90256c004e5 Mon Sep 17 00:00:00 2001 | |
From: Robbo <robbo.clancy@gmail.com> | |
Date: Fri, 12 Dec 2014 13:51:52 +1100 | |
Subject: [PATCH] made future date stuff ignore the current status | |
--- | |
pelican/contents.py | 14 +++++++------- | |
1 file changed, 7 insertions(+), 7 deletions(-) | |
diff --git a/pelican/contents.py b/pelican/contents.py | |
index c3d1230..ad2ca1e 100644 | |
--- a/pelican/contents.py | |
+++ b/pelican/contents.py | |
@@ -133,13 +133,13 @@ class Content(object): | |
# manage status | |
if not hasattr(self, 'status'): | |
self.status = settings['DEFAULT_STATUS'] | |
- if not settings['WITH_FUTURE_DATES'] and hasattr(self, 'date'): | |
- if self.date.tzinfo is None: | |
- now = SafeDatetime.now() | |
- else: | |
- now = SafeDatetime.utcnow().replace(tzinfo=pytz.utc) | |
- if self.date > now: | |
- self.status = 'draft' | |
+ if not settings['WITH_FUTURE_DATES'] and hasattr(self, 'date'): | |
+ if self.date.tzinfo is None: | |
+ now = SafeDatetime.now() | |
+ else: | |
+ now = SafeDatetime.utcnow().replace(tzinfo=pytz.utc) | |
+ if self.date > now: | |
+ self.status = 'draft' | |
# store the summary metadata if it is set | |
if 'summary' in metadata: | |
-- | |
2.1.3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment