summary: Correctly return the Node instance
Noticed that I was returning the ReadmeMatch instance.
This commit is contained in:
parent
c5898bf7ee
commit
c6206d900b
2 changed files with 4 additions and 4 deletions
|
|
@ -101,7 +101,7 @@ class SummaryController(BaseRepoController):
|
|||
renderer = MarkupRenderer()
|
||||
try:
|
||||
return renderer.render(
|
||||
readme_node.content, filename=readme_node.file)
|
||||
readme_node.content, filename=readme_node.path)
|
||||
except Exception:
|
||||
log.exception(
|
||||
"Exception while trying to render the README")
|
||||
|
|
|
|||
|
|
@ -987,7 +987,7 @@ class ReadmeFinder:
|
|||
matches = self._match_readmes(nodes)
|
||||
matches = self._sort_according_to_priority(matches)
|
||||
if matches:
|
||||
return matches[0]
|
||||
return matches[0].node
|
||||
|
||||
paths = self._match_paths(nodes)
|
||||
paths = self._sort_paths_according_to_priority(paths)
|
||||
|
|
@ -1041,13 +1041,13 @@ class ReadmeFinder:
|
|||
class ReadmeMatch:
|
||||
|
||||
def __init__(self, node, match, priority):
|
||||
self._node = node
|
||||
self.node = node
|
||||
self._match = match
|
||||
self.priority = priority
|
||||
|
||||
@property
|
||||
def path(self):
|
||||
return self._node.path
|
||||
return self.node.path
|
||||
|
||||
def __repr__(self):
|
||||
return '<ReadmeMatch {} priority={}'.format(self.path, self.priority)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue