Skip to content

Commit

Permalink
Show 404 page when requesting a level that does not exist. (hedyorg#1146
Browse files Browse the repository at this point in the history
)
  • Loading branch information
fpereiro authored Nov 1, 2021
1 parent ba6c6ec commit 9d4ee23
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,8 @@ def index(level, step):

adventures = load_adventures_per_level(requested_lang(), level)
level_defaults_for_lang = LEVEL_DEFAULTS[requested_lang()]
if level not in level_defaults_for_lang.levels:
return utils.page_404 (TRANSLATIONS, render_main_menu('hedy'), current_user(request) ['username'], requested_lang (), TRANSLATIONS.get_translations (requested_lang (), 'ui').get ('no_such_level'))
defaults = level_defaults_for_lang.get_defaults_for_level(level)
max_level = level_defaults_for_lang.max_level()

Expand Down

0 comments on commit 9d4ee23

Please sign in to comment.