diff options
author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2015-01-03 19:28:15 +0100 |
---|---|---|
committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2015-01-07 21:54:22 +0100 |
commit | 127f9e073d83904defd4bde4eaa4491f3306ca25 (patch) | |
tree | 29517d65351d6390d386f4579ee86f53ad0985ce /django | |
parent | eaa1a22341aef5b92f5c3cd682f01e61c4159262 (diff) | |
download | django-127f9e073d83904defd4bde4eaa4491f3306ca25.tar.gz |
Restored support for multiple template names in render(_to_response).
This possibility was documented but not tested.
It had been broken during the multiple template engines refactor.
Diffstat (limited to 'django')
-rw-r--r-- | django/shortcuts.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/django/shortcuts.py b/django/shortcuts.py index a8f7278bcb..b43c23a891 100644 --- a/django/shortcuts.py +++ b/django/shortcuts.py @@ -32,7 +32,7 @@ def render_to_response(template_name, context=None, and dirs is _dirs_undefined and dictionary is _dictionary_undefined): # No deprecated arguments were passed - use the new code path - content = loader.get_template(template_name).render(context) + content = loader.render_to_string(template_name, context) else: # Some deprecated arguments were passed - use the legacy code path @@ -56,7 +56,8 @@ def render(request, template_name, context=None, and dirs is _dirs_undefined and dictionary is _dictionary_undefined): # No deprecated arguments were passed - use the new code path - content = loader.get_template(template_name).render(context, request) + # In Django 2.0, request should become a positional argument. + content = loader.render_to_string(template_name, context, request=request) else: # Some deprecated arguments were passed - use the legacy code path |