#21468 closed Bug (fixed)

Django 1.5: Docs on ModelForm validation are wrong

Reported by: direx Owned by: nobody
Component: Documentation Version: 1.5
Severity: Normal Keywords: model form validation
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


From docs/topics/forms/modelforms.txt#validation-on-a-modelform:

Model validation (Model.full_clean()) is triggered from within the form validation step, right after the form’s clean() method is called.

This is wrong. Prior to Django 1.6 only Model.clean() is called by BaseModelForm._post_clean().

There are two options here:

Change History (2)

comment:1 Changed 23 months ago by bmispelon

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


Indeed, it seems that some documentation fixes were backported with 3860d5e8f814e26baf4deee9258392cd34a4b456 and they contain sentences that only apply to later versions of Django.

The first option is the way to go here, since new features don't normally get backported (only sever bug fixes and security-related patches are).


comment:2 Changed 23 months ago by Baptiste Mispelon <bmispelon@…>

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

In ed8814b24a18cecdeb2631281bceb2f8432a2546:

Fixed #21468 -- Removed a ModelForm bit that doesn't apply to 1.5.x.

The bit was incorrectly backported with 3860d5e8f814e26baf4deee9258392cd34a4b456.

Thanks to trac user direx for the report and to Loic Bistuer
for his help.

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