find_url_for_node: fail early when node has no valid project

This commit is contained in:
Sybren A. Stüvel 2017-09-14 12:08:08 +02:00
parent 230c15d51c
commit e09649586f

View File

@ -125,6 +125,8 @@ def find_url_for_node(node):
project = node.project
else:
project = project_url(node.project, None)
if not project:
raise ValueError(f'Project {node.project} not found')
# Determine which function to use to find the correct URL.
finder = node_url_finders.get(node.node_type, find_for_other)