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.
Fixed #21587 Adds deprecation warning to RedirectView and adds test f…
Added documentation for ticket #21587
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?
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
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.
@Gwildor yes, you are completely right:
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.
Closing this in favor of #2564.