1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #14936 -- Tweaked the new render shortcut to reflect non-legacy arguments. Thanks to adamv for the report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15020 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee
2010-12-22 04:54:10 +00:00
parent 6e75ee2b32
commit 0fef92f6f0
5 changed files with 30 additions and 12 deletions

View File

@@ -25,7 +25,10 @@ def render(request, *args, **kwargs):
django.template.loader.render_to_string() with the passed arguments.
Uses a RequestContext by default.
"""
httpresponse_kwargs = {'mimetype': kwargs.pop('mimetype', None)}
httpresponse_kwargs = {
'content_type': kwargs.pop('content_type', None),
'status': kwargs.pop('status', None),
}
kwargs['context_instance'] = kwargs.get('context_instance', RequestContext(request))
return HttpResponse(loader.render_to_string(*args, **kwargs),
**httpresponse_kwargs)