]> git.ipfire.org Git - ipfire.org.git/commitdiff
wiki: Fix fetching any watched pages
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 9 Oct 2023 16:27:21 +0000 (16:27 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 9 Oct 2023 16:27:21 +0000 (16:27 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/backend/wiki.py

index 2a5798bef5a46fcf283e87ea0b760ec3d1848881..3ce17944574c1b1c689e02d70298ef2269bd4748 100644 (file)
@@ -166,13 +166,25 @@ class Wiki(misc.Object):
                self.db.execute("REFRESH MATERIALIZED VIEW wiki_search_index")
 
        def get_watchlist(self, account):
-               pages = self._get_pages(
-                       "WITH pages AS (SELECT * FROM wiki_current \
-                                       LEFT JOIN wiki ON wiki_current.id = wiki.id) \
-                       SELECT * FROM wiki_watchlist watchlist \
-                               LEFT JOIN pages ON watchlist.page = pages.page \
-                               WHERE watchlist.uid = %s",
-                       account.uid,
+               pages = self._get_pages("""
+                       WITH pages AS (
+                               SELECT
+                                       *
+                               FROM
+                                       wiki_current
+                               LEFT JOIN
+                                       wiki ON wiki_current.id = wiki.id
+                       )
+
+                       SELECT
+                               *
+                       FROM
+                               wiki_watchlist watchlist
+                       JOIN
+                               pages ON watchlist.page = pages.page
+                       WHERE
+                               watchlist.uid = %s
+                       """, account.uid,
                )
 
                return sorted(pages)