mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 12:11:33 -06:00
Fix regression on 404 redirects
This commit is contained in:

committed by
black-sliver

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