aboutsummaryrefslogtreecommitdiffstats
path: root/pysite
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2018-05-02 13:37:49 +0100
committerGravatar Gareth Coles <[email protected]>2018-05-02 13:37:49 +0100
commit9d11f558395f0450fbbe1e8d323917dff3ebe167 (patch)
tree253633b25ca369bddb60b390081760475da07093 /pysite
parentAdd special pages and an "all pages" special page (diff)
[All Pages] Account for pages without a title when sorting
Diffstat (limited to 'pysite')
-rw-r--r--pysite/views/wiki/special/all_pages.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/pysite/views/wiki/special/all_pages.py b/pysite/views/wiki/special/all_pages.py
index 2d5376aa..1305fc29 100644
--- a/pysite/views/wiki/special/all_pages.py
+++ b/pysite/views/wiki/special/all_pages.py
@@ -1,5 +1,3 @@
-from operator import itemgetter
-
from pysite.base_route import RouteView
from pysite.mixins import DBMixin
@@ -11,7 +9,7 @@ class PageView(RouteView, DBMixin):
def get(self):
pages = self.db.pluck(self.table_name, "title", "slug")
- pages = sorted(pages, key=itemgetter("title"))
+ pages = sorted(pages, key=lambda d: d.get("title", "No Title"))
letters = {}