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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user