diff options
| author | Tim Graham <timograham@gmail.com> | 2015-01-18 16:43:57 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-01-18 17:43:06 -0500 |
| commit | 6e13c0490d67cdf210411f08feca3b78a49645ea (patch) | |
| tree | 5d9bc14688364af1d58ca38b6ac6e5877481f6a1 /django | |
| parent | bd98926f0eb19d27821a8a7679b42ff46e53e4da (diff) | |
Changed RedirectView.permanent to False per deprecation timeline; refs #21587.
Diffstat (limited to 'django')
| -rw-r--r-- | django/views/generic/base.py | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/django/views/generic/base.py b/django/views/generic/base.py index e9aac357f4..a873f11f05 100644 --- a/django/views/generic/base.py +++ b/django/views/generic/base.py @@ -1,7 +1,6 @@ from __future__ import unicode_literals import logging -import warnings from functools import update_wrapper from django import http @@ -9,10 +8,8 @@ from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import reverse, NoReverseMatch from django.template.response import TemplateResponse from django.utils.decorators import classonlymethod -from django.utils.deprecation import RemovedInDjango19Warning from django.utils import six -_sentinel = object() logger = logging.getLogger('django.request') @@ -163,36 +160,11 @@ class RedirectView(View): """ A view that provides a redirect on any GET request. """ - permanent = _sentinel + permanent = False url = None pattern_name = None query_string = False - def __init__(self, *args, **kwargs): - if 'permanent' not in kwargs and self.permanent is _sentinel: - warnings.warn( - "Default value of 'RedirectView.permanent' will change " - "from True to False in Django 1.9. Set an explicit value " - "to silence this warning.", - RemovedInDjango19Warning, - stacklevel=2 - ) - self.permanent = True - super(RedirectView, self).__init__(*args, **kwargs) - - @classonlymethod - def as_view(cls, **initkwargs): - if 'permanent' not in initkwargs and cls.permanent is _sentinel: - warnings.warn( - "Default value of 'RedirectView.permanent' will change " - "from True to False in Django 1.9. Set an explicit value " - "to silence this warning.", - RemovedInDjango19Warning, - stacklevel=2 - ) - initkwargs['permanent'] = True - return super(RedirectView, cls).as_view(**initkwargs) - def get_redirect_url(self, *args, **kwargs): """ Return the URL redirect to. Keyword arguments from the |
