Commit 9a57d05b by Chris Jerdonek

Renderer.get_associated_template() now handles locator.get_object_directory() returning None.

parent 4b8c7a70
......@@ -263,11 +263,16 @@ class Renderer(object):
class definition.
"""
search_dirs = self.search_dirs
locator = self.make_locator()
template_name = locator.make_template_name(obj)
directory = locator.get_object_directory(obj)
search_dirs = [directory] + self.search_dirs
# TODO: add a unit test for the case of a None return value.
if directory is not None:
search_dirs = [directory] + self.search_dirs
path = locator.locate_path(template_name=template_name, search_dirs=search_dirs)
return self.read(path)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment