]> git.ipfire.org Git - ipfire.org.git/commitdiff
wiki: Fast-path looking up pages that should be an action
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 1 Jul 2023 10:21:01 +0000 (10:21 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 1 Jul 2023 10:21:01 +0000 (10:21 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/backend/wiki.py

index 3044a8c84ea47f95d8de0a2d7007ef87ae410d14..4be8550c860cd279955f34ed89a1ff2490e312d7 100644 (file)
@@ -75,7 +75,13 @@ class Wiki(misc.Object):
 
        def get_page(self, page, revision=None):
                page = Page.sanitise_page_name(page)
-               assert page
+
+               # Split the path into parts
+               parts = page.split("/")
+
+               # Check if this is an action
+               if any((part.startswith("_") for part in parts)):
+                       return
 
                if revision:
                        return self._get_page("SELECT * FROM wiki WHERE page = %s \