Opened 11 years ago

Closed 10 years ago

Last modified 8 years ago

#6675 closed Uncategorized (wontfix)

Better error message if cleaned_data is missing (unbound Form)

Reported by: Thomas Güttler Owned by: nobody
Component: Forms Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Up to now cleaned_data gets added and removed from forms. For people new to django,
it would be nice to have a better error message:


AttributeError: 'Person' object has no attribute 'cleaned_data'


<MyForm object at 0x55555647c890>: Unbound Fields have no cleaned_data attribute

Patch incl. modification of unittest attached.

Attachments (1)

newforms_better_error_message_if_unbound.diff (3.0 KB) - added by Thomas Güttler 11 years ago.

Download all attachments as: .zip

Change History (6)

Changed 11 years ago by Thomas Güttler

comment:1 Changed 11 years ago by Thomas Güttler

Better patch. Access to 'errors' was disabled by first patch.

comment:2 Changed 11 years ago by Jeff Anderson

Triage Stage: UnreviewedAccepted

+1 This would help make troubleshooting more clear.

comment:3 Changed 10 years ago by Chris Beaven

Resolution: wontfix
Status: newclosed

That message is even more confusing, since we're talking about a Form not a Field.

Also, this patch is stopping attribute access to forms, which is completely backwards incompatible.

comment:4 Changed 10 years ago by Thomas Güttler

Yes, SmileyChris, this was a typo. The *Form* is unbound.

Nevertheless disappearing attributes are bad. But I don't now a better patch.

comment:5 Changed 8 years ago by Thomas Güttler

Cc: hv@… removed
Easy pickings: unset
Severity: Normal
Type: Uncategorized
UI/UX: unset

Related (stop cleaned_data from disappearing).

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