Handle the case when there is no menu_structure in config

This commit is contained in:
German Ilyin 2016-05-12 19:56:18 +06:00 committed by Iacopo Spalletti
parent fb89f3b239
commit 5a8f9fdf03
No known key found for this signature in database
GPG key ID: BDCBC2EB289F60C6

View file

@ -125,7 +125,11 @@ class BlogNavModifier(Modifier):
if app and app.app_config:
namespace = resolve(request.path).namespace
config = app.get_config(namespace)
if config and config.menu_structure != MENU_TYPE_CATEGORIES:
try:
if config and config.menu_structure != MENU_TYPE_CATEGORIES:
return nodes
except AttributeError:
# in case `menu_structure` is not present in config
return nodes
if post_cut:
return nodes