Skip to content

Commit

Permalink
[#808] Fix unicode template 500 error
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Apr 29, 2013
1 parent 8d4cbb9 commit 4fb36e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions ckan/lib/base.py
Expand Up @@ -134,8 +134,9 @@ def render_template():
return render_jinja2(template_name, globs)

# Genshi templates
template = globs['app_globals'].genshi_loader.load(template_name,
cls=loader_class)
template = globs['app_globals'].genshi_loader.load(
template_name.encode('utf-8'), cls=loader_class
)
stream = template.generate(**globs)

for item in PluginImplementations(IGenshiStreamFilter):
Expand Down
2 changes: 1 addition & 1 deletion ckan/lib/render.py
Expand Up @@ -10,7 +10,7 @@ def find_template(template_name):
returns the full path is it exists. '''
template_paths = config['pylons.app_globals'].template_paths
for path in template_paths:
if os.path.exists(os.path.join(path, template_name)):
if os.path.exists(os.path.join(path, template_name.encode('utf-8'))):
return os.path.join(path, template_name)

def template_type(template_path):
Expand Down

0 comments on commit 4fb36e6

Please sign in to comment.