diff options
| author | Tim Graham <timograham@gmail.com> | 2015-09-03 15:52:04 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-09-23 19:31:10 -0400 |
| commit | 5e450c52aafb62b9d83c8ac08892e0b92cbec4aa (patch) | |
| tree | dbc6b0360aba68d492dc0925d527c9c0f237f401 /django/shortcuts.py | |
| parent | 75374d3797c2cd2423982a870bb0bc74821e951f (diff) | |
Removed current_app argument to render() and TemplateResponse().
Per deprecation timeline.
Diffstat (limited to 'django/shortcuts.py')
| -rw-r--r-- | django/shortcuts.py | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/django/shortcuts.py b/django/shortcuts.py index 7c7e61fb5c..4bfc2dcfb2 100644 --- a/django/shortcuts.py +++ b/django/shortcuts.py @@ -3,9 +3,6 @@ This module collects helper functions and classes that "span" multiple levels of MVC. In other words, these functions/classes introduce controlled coupling for convenience's sake. """ - -import warnings - from django.core import urlresolvers from django.db.models.base import ModelBase from django.db.models.manager import Manager @@ -14,12 +11,10 @@ from django.http import ( Http404, HttpResponse, HttpResponsePermanentRedirect, HttpResponseRedirect, ) from django.template import RequestContext, loader -from django.template.context import _current_app_undefined from django.template.engine import ( _context_instance_undefined, _dictionary_undefined, _dirs_undefined, ) from django.utils import six -from django.utils.deprecation import RemovedInDjango110Warning from django.utils.encoding import force_text from django.utils.functional import Promise @@ -49,7 +44,7 @@ def render_to_response(template_name, context=None, def render(request, template_name, context=None, context_instance=_context_instance_undefined, - content_type=None, status=None, current_app=_current_app_undefined, + content_type=None, status=None, dirs=_dirs_undefined, dictionary=_dictionary_undefined, using=None): """ @@ -58,32 +53,18 @@ def render(request, template_name, context=None, Uses a RequestContext by default. """ if (context_instance is _context_instance_undefined - and current_app is _current_app_undefined and dirs is _dirs_undefined and dictionary is _dictionary_undefined): # No deprecated arguments were passed - use the new code path # In Django 1.10, request should become a positional argument. content = loader.render_to_string( template_name, context, request=request, using=using) - else: # Some deprecated arguments were passed - use the legacy code path if context_instance is not _context_instance_undefined: - if current_app is not _current_app_undefined: - raise ValueError('If you provide a context_instance you must ' - 'set its current_app before calling render()') + pass else: context_instance = RequestContext(request) - if current_app is not _current_app_undefined: - warnings.warn( - "The current_app argument of render is deprecated. " - "Set the current_app attribute of request instead.", - RemovedInDjango110Warning, stacklevel=2) - request.current_app = current_app - # Directly set the private attribute to avoid triggering the - # warning in RequestContext.__init__. - context_instance._current_app = current_app - content = loader.render_to_string( template_name, context, context_instance, dirs, dictionary, using=using) |
