diff --git a/tailbone/menus.py b/tailbone/menus.py index 46f5c62a..8b432879 100644 --- a/tailbone/menus.py +++ b/tailbone/menus.py @@ -351,7 +351,11 @@ def make_menu_entry(request, item): } if item.get('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'] else: if item.get('url'):