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,8 +125,12 @@ class BlogNavModifier(Modifier):
if app and app.app_config:
namespace = resolve(request.path).namespace
config = app.get_config(namespace)
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
current_post = getattr(request, get_setting('CURRENT_POST_IDENTIFIER'), None)