Prevent {{ url_for_node(...) }} crashing the planet when node doesn't exist.
Now None is returned as URL, and a warning is logged, rather than crashing with a 500. A situation like this occurs when an activity refers to a no longer existing node.
This commit is contained in:
@@ -593,7 +593,7 @@ def url_for_node(node_id=None, node=None):
|
||||
log.warning(
|
||||
'url_for_node(node_id=%r, node=None): Unable to find node.',
|
||||
node_id)
|
||||
raise ValueError('Unable to find node %r' % node_id)
|
||||
raise NotFound('Unable to find node %r' % node_id)
|
||||
|
||||
return finders.find_url_for_node(node)
|
||||
|
||||
|
Reference in New Issue
Block a user