The provided patch introduces a backward compatibility issue for users
that overrided `get_form()` on a `ProcessFormView` subclass and expected
`form_class` to be `not None`. It could be addressed by removing the
changes in `ProcessFormView.get()` and `ProcessFormView.post()`.
--
Ticket URL: <https://code.djangoproject.com/ticket/23656>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* stage: Unreviewed => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/23656#comment:1>
* stage: Ready for checkin => Accepted
Comment:
I'll move it to ''Accepted'' until I either get a consensus on the mailing
list about the backward compatibility issues or I find time to avoid
breaking the following case:
{{{#!python
class MyFormMixin(FormMixin):
def get_form(form_class):
return form_class(...)
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23656#comment:2>
* needs_better_patch: 0 => 1
Comment:
Okay, marking as "patch needs improvement" in the meantime so this doesn't
appear in the review queue.
--
Ticket URL: <https://code.djangoproject.com/ticket/23656#comment:3>
* needs_better_patch: 1 => 0
Comment:
I think I came up with a decent solution.
If someone overrides `get_form` without defining a default value for
`form_class` a deprecation warning is raised and the unbound method is
wrapped in order to make sure `form_class` defaults to `get_form_class()`
if not provided.
I updated the PR with the POC. I guess we should we also mention this
change in the deprecated section of the release notes?
--
Ticket URL: <https://code.djangoproject.com/ticket/23656#comment:4>
Comment (by timgraham):
Yes, and of course the deprecation timeline as well.
--
Ticket URL: <https://code.djangoproject.com/ticket/23656#comment:5>
Comment (by charettes):
Added the missing deprecation note and a mention in the deprecation
timeline.
--
Ticket URL: <https://code.djangoproject.com/ticket/23656#comment:6>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/23656#comment:7>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"f2ddc439b1938acb6cae693bda9d8cf83a4583be"]:
{{{
#!CommitTicketReference repository=""
revision="f2ddc439b1938acb6cae693bda9d8cf83a4583be"
Fixed #23656 -- Made FormMixin.get_form's form_class argument optional.
Thanks Tim Graham for the review.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23656#comment:8>
Comment (by Tim Graham <timograham@…>):
In [changeset:"491de4f07c5018aa6f409dbc9bcf32ff631d5f2e" 491de4f0]:
{{{
#!CommitTicketReference repository=""
revision="491de4f07c5018aa6f409dbc9bcf32ff631d5f2e"
Refs #23656 -- Required FormMixin.get_form() form_class parameter to be
optional.
Per deprecation timeline.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/23656#comment:9>