#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)
Change History (6)
by , 17 years ago
Attachment: | newforms_better_error_message_if_unbound.diff added |
---|
comment:1 by , 17 years ago
comment:2 by , 17 years ago
Triage Stage: | Unreviewed → Accepted |
---|
+1 This would help make troubleshooting more clear.
comment:3 by , 15 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
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 , 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 , 13 years ago
Cc: | removed |
---|---|
Easy pickings: | unset |
Severity: | → Normal |
Type: | → Uncategorized |
UI/UX: | unset |
Related https://code.djangoproject.com/ticket/5524 (stop cleaned_data from disappearing).
Better patch. Access to 'errors' was disabled by first patch.