Suppress error if menu entry has bad route name
This commit is contained in:
		
							parent
							
								
									f8f6b76657
								
							
						
					
					
						commit
						f388f84b07
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -351,7 +351,11 @@ def make_menu_entry(request, item):
 | 
			
		|||
    }
 | 
			
		||||
    if item.get('route'):
 | 
			
		||||
        entry['route'] = item['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'):
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue