Code

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#15657 closed (fixed)

Missing `form` argument in FormMixin documentation

Reported by: jnns 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: UI/UX:

Description

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.

Attachments (0)

Change History (3)

comment:1 Changed 3 years ago by gabrielhurley

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 3 years ago by gabrielhurley

  • Resolution set to fixed
  • Status changed from new to closed

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 3 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.