]> git.ipfire.org Git - ipfire.org.git/commitdiff
backend/blog.py: changed how latest posts are returned
authorRico Hoppe <rico.hoppe@ipfire.org>
Fri, 23 Jun 2023 00:13:02 +0000 (00:13 +0000)
committerRico Hoppe <rico.hoppe@ipfire.org>
Fri, 23 Jun 2023 00:13:02 +0000 (00:13 +0000)
src/backend/blog.py

index 63d904630fb5eeafdfcef5c5711990ee7807aaef..a22098428a26cf6977634ac6471ffc77cae1cc29 100644 (file)
@@ -39,11 +39,13 @@ class Blog(misc.Object):
                        WHERE slug = %s", slug)
 
        def get_newest(self, limit=None):
-               return self._get_posts("SELECT * FROM blog \
+               posts = self._get_posts("SELECT * FROM blog \
                        WHERE published_at IS NOT NULL \
                                AND published_at <= NOW() \
                        ORDER BY published_at DESC LIMIT %s", limit)
 
+               return list(posts)
+
        def get_by_tag(self, tag, limit=None):
                return self._get_posts("SELECT * FROM blog \
                        WHERE published_at IS NOT NULL \