Fix regression on 404 redirects

This commit is contained in:
massimilianodelliubaldini
2025-08-02 22:50:59 -04:00
committed by black-sliver
parent d408f7cabc
commit 84c2d70d9a

View File

@@ -87,6 +87,7 @@ def start_playing():
@cache.cached()
def game_info(game, lang):
"""Game Info Pages"""
try:
theme = get_world_theme(game)
secure_game_name = secure_filename(game)
lang = secure_filename(lang)
@@ -100,6 +101,8 @@ def game_info(game, lang):
html_from_markdown=document,
theme=theme,
)
except FileNotFoundError:
return abort(404)
@app.route('/games')
@@ -112,6 +115,7 @@ def games():
@app.route('/tutorial/<string:game>/<string:file>')
@cache.cached()
def tutorial(game: str, file: str):
try:
theme = get_world_theme(game)
secure_game_name = secure_filename(game)
file = secure_filename(file)
@@ -125,6 +129,8 @@ def tutorial(game: str, file: str):
html_from_markdown=document,
theme=theme,
)
except FileNotFoundError:
return abort(404)
@app.route('/tutorial/')