diff --git a/ckan/lib/jinja_extensions.py b/ckan/lib/jinja_extensions.py index a499276f520..913e33573c3 100644 --- a/ckan/lib/jinja_extensions.py +++ b/ckan/lib/jinja_extensions.py @@ -106,13 +106,13 @@ def parse(self, parser): node = nodes.Extends(lineno) template_path = parser.filename # find where in the search path this template is from - index = 0 + current_path = None if not hasattr(self, 'searchpath'): return node for searchpath in self.searchpath: if template_path.startswith(searchpath): + current_path = searchpath break - index += 1 # get filename from full path filename = template_path[len(searchpath) + 1:] @@ -128,8 +128,8 @@ def parse(self, parser): % template_path) # provide our magic format - # format is **