]> git.ipfire.org Git - ipfire.org.git/commitdiff
blog: Fix last publications check if we have posts to be released in the future
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 10 Dec 2019 13:01:15 +0000 (13:01 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 10 Dec 2019 13:01:15 +0000 (13:01 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/backend/blog.py

index ceb438a1ce31f49ad268a8b36f3303655502230c..6d2e0ac35d763c84b78763e2c73eb362efb8f605 100644 (file)
@@ -92,7 +92,7 @@ class Blog(misc.Object):
                t = datetime.timedelta(**kwargs)
 
                res = self.db.get("SELECT COUNT(*) AS count FROM blog \
-                       WHERE published_at IS NOT NULL AND published_at >= NOW() - %s", t)
+                       WHERE published_at IS NOT NULL AND published_at BETWEEN NOW() - %s AND NOW()", t)
 
                if res and res.count > 0:
                        return True