Fixes #21587 Added Deprecation Warning for upcoming permanent default #2432

wants to merge 2 commits into from

5 participants


As noted in the ticket, we need a deprecation warning. This adds the warning into the current version, a test to make sure the warning indeed warns, and then changes to the documentation about the upcoming change.


I'm not sure if it's going to work like that (but correct me if I'm wrong!), because what if the user has set the flag as an attribute on the view instead of passing it along when initializing the view?

My suggestion:

permanent = None

def __init__(self, *args, **kwargs):
    super(RedirectView, self).__init__(*args, **kwargs)

    if self.permanent is None:
        self.permanent = True  # set old value for the backwards compatibility
        # warning here
Django member

I agree with gwildor's comment, but not with that particular code: that would ignore a permanent kwarg. Also, a change like this should be added to the release notes.


@erikr, I was under the assumption that the __init__ method in View would set the kwargs as attribute on the view, via the initkwargs argument passed onto the as_view method. Actually I moved the super up to the first line just for that reason alone.

Django member

Please see Deprecating a feature for a checklist of items that must be completed. Note that 1.7 is feature frozen pending the release of the beta, so you should probably hold off on this until we cut the 1.7 branch and master is reopened for changes.

Django member

Closing this in favor of #2564.

@bmispelon bmispelon closed this Apr 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment