Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#17155 closed Bug (worksforme)

ModelForm.clean() return value not applied to instance when used in a modelformset

Reported by: anonymous Owned by: nobody
Component: Forms Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Define a form with a clean method that alters the values in self.cleaned_data before returning them. If you use the form in a modelformset, the values returned by form.clean are not applied to the model instance upon saving the formset (possibly related to #12960).

Attachments (1)

17155-test.diff (1.5 KB ) - added by Claude Paroz 13 years ago.
Test custom clean with model formsets

Download all attachments as: .zip

Change History (3)

comment:1 by Claude Paroz, 13 years ago

Resolution: worksforme
Status: newclosed

Attached is a test that is currently passing. If you can make a test that fails, then please reopen the ticket.

by Claude Paroz, 13 years ago

Attachment: 17155-test.diff added

Test custom clean with model formsets

comment:2 by anonymous, 13 years ago

My sincere apologies for the time wasted. It helps to not put the field you're altering into the form's exclude.

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