Skip to content

Commit

Permalink
Fixed render_response to test for content type.
Browse files Browse the repository at this point in the history
--HG--
branch : trunk
  • Loading branch information
bbangert committed Mar 18, 2008
1 parent 8e17c59 commit adb0f75
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pylons/templating.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,11 @@ def view(self):
warnings.warn(pylons.legacy.render_response_warning, DeprecationWarning, 2)

response = pylons.response._current_obj()
response.content = render(*args, **kargs)
content = render(*args, **kargs)
if isinstance(content, unicode):
response.unicode_body = content
else:
response.content = content
output_encoding = kargs.get('output_encoding')
encoding_errors = kargs.get('encoding_errors')
if output_encoding:
Expand Down

0 comments on commit adb0f75

Please sign in to comment.