diff --git a/app/__init__.py b/app/__init__.py index d8c81a6..01d01ad 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -24,8 +24,6 @@ def get_all_names(): def get_page(name: str) -> WikiPage: - if name not in get_all_names(): - raise Exception("Page doesn't exist!") path = f'{PANDOC_PATH}/{name}' with open(f'{path}/config.json', 'r') as f: page = WikiPage.parse_raw(f.read()) @@ -47,6 +45,8 @@ def dated_url_for(endpoint, **values): @app.route(f'/{PANDOC_LINK}/') def get_pandoc_page(name: str): + if name not in get_all_names(): + return "Page doesn't exist" page = get_page(name) template = page.template with open(page.get_file('render.html'), 'r') as f: