Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#15657 closed (fixed)

Missing `form` argument in FormMixin documentation

Reported by: Jannis Owned by: nobody
Component: Documentation Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


The documentations of FormMixin and ModelFormMixin seem to miss the form argument that is required to execute both methods form_valid() and form_invalid().

class FormMixin:
def form_valid(self, form):
    return HttpResponseRedirect(self.get_success_url())
def form_invalid(self, form):
    return self.render_to_response(self.get_context_data(form=form))
.. method:: form_valid()

     Redirects to :meth:`.get_success_url`.

.. method:: form_invalid()

     Renders a response, providing the invalid form as context.

Change History (3)

comment:1 Changed 8 years ago by Gabriel Hurley

Triage Stage: UnreviewedAccepted

comment:2 Changed 8 years ago by Gabriel Hurley

Resolution: fixed
Status: newclosed

In [15895]:

Fixed #15657 -- added the required form parameter to the method signatures of form_valid and form_invalid in the FormMixin docs. Thanks to jnns for the report.

comment:3 Changed 7 years ago by Jacob

milestone: 1.3

Milestone 1.3 deleted

Note: See TracTickets for help on using tickets.
Back to Top