Opened 16 years ago

Closed 15 years ago

Last modified 12 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: dev
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

Description

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:

Old:

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

New:

<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 16 years ago.

Download all attachments as: .zip

Change History (6)

by Thomas Güttler, 16 years ago

comment:1 by Thomas Güttler, 16 years ago

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

comment:2 by Jeff Anderson, 16 years ago

Triage Stage: UnreviewedAccepted

+1 This would help make troubleshooting more clear.

comment:3 by Chris Beaven, 15 years ago

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 by Thomas Güttler, 15 years ago

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 by Thomas Güttler, 12 years ago

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

Related https://code.djangoproject.com/ticket/5524 (stop cleaned_data from disappearing).

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