# HG changeset patch # User Sverre Rabbelier # Date 1236893887 0 # Node ID a0ab93cc3cd50df42cecd891860d10b8e66f0e3d # Parent 75d3c138473632dc45fd1e2b53b91f500a6a1f8c Strip leading and trailing newlines from our responses Without this CSV exports look funny. Patch by: Sverre Rabbelier diff -r 75d3c1384736 -r a0ab93cc3cd5 app/soc/views/helper/responses.py --- a/app/soc/views/helper/responses.py Thu Mar 12 21:37:38 2009 +0000 +++ b/app/soc/views/helper/responses.py Thu Mar 12 21:38:07 2009 +0000 @@ -74,8 +74,10 @@ if response_args is None: response_args = {} - response_args['content'] = response_args.get( - 'content', loader.render_to_string(template, dictionary=context)) + if 'content' not in response_args: + content = loader.render_to_string(template, dictionary=context) + response_args['content'] = content.strip('\n') + http_response = http.HttpResponse(**response_args) if response_headers: