Suppress error if menu entry has bad route name
This commit is contained in:
parent
f8f6b76657
commit
f388f84b07
|
@ -351,7 +351,11 @@ def make_menu_entry(request, item):
|
||||||
}
|
}
|
||||||
if item.get('route'):
|
if item.get('route'):
|
||||||
entry['route'] = item['route']
|
entry['route'] = item['route']
|
||||||
entry['url'] = request.route_url(entry['route'])
|
try:
|
||||||
|
entry['url'] = request.route_url(entry['route'])
|
||||||
|
except KeyError: # happens if no such route
|
||||||
|
log.warning("invalid route name for menu entry: %s", entry)
|
||||||
|
entry['url'] = entry['route']
|
||||||
entry['key'] = entry['route']
|
entry['key'] = entry['route']
|
||||||
else:
|
else:
|
||||||
if item.get('url'):
|
if item.get('url'):
|
||||||
|
|
Loading…
Reference in a new issue