diff options
author | Ludovic Chabant <ludovic@chabant.com> | 2018-11-20 05:01:28 +0000 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2018-11-20 07:50:52 -0500 |
commit | fab28eb1fd67c78f7471cbb38fc304b201b18244 (patch) | |
tree | 2ff227dd8ce4ece02b2f9a84775968a4b57a9960 | |
parent | b795c41a4eaf5253386b74ce3dfe8278457d6528 (diff) |
Fix a templating crash when the root wiki is empty.
-rw-r--r-- | mansrht/blueprints/html.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mansrht/blueprints/html.py b/mansrht/blueprints/html.py index 9421c21..28cbf0e 100644 --- a/mansrht/blueprints/html.py +++ b/mansrht/blueprints/html.py @@ -19,7 +19,10 @@ repo_path = cfg("man.sr.ht", "repo-path") def content(repo, path, wiki=None, is_root=False, **kwargs): master = repo.branches.get("master") if not master: - return render_template("new-wiki.html", wiki=wiki) + if wiki: + return render_template("new-wiki.html", wiki=wiki) + # Root wiki with no content. + return render_template("index.html") commit = repo.get(master.target) tree = commit.tree _path = path |