Opened 17 years ago
Closed 17 years ago
#4387 closed (invalid)
newforms: ErrorDict.as_ul() needs to handle a list of errors
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Forms | Version: | dev |
Severity: | 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
Hi,
ErrorDict.as_ul() did not handle its dictionary if errors
as a list.
This patch does this. I gues this code gets only called if
you use "print myerrordict" for debugging.
Attachments (1)
Change History (4)
by , 17 years ago
Attachment: | newformsutils-printerrordict.diff added |
---|
comment:1 by , 17 years ago
Needs tests: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 17 years ago
Needs tests: | unset |
---|---|
Triage Stage: | Accepted → Unreviewed |
comment:3 by , 17 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Yes, this path is not necessary. I tried to write a ErrorDict to stout (for debugging: print myform.errors).
This resulted in a UnicodeError. Since as_text() loops over each value of the dict, I thought it would
be necessary for as_ul(), too. But the real problem is that writing to stout for debugging
does not handle unicode.
This patch doesn't make sense. For a start, it doesn't pass the tests. More importantly, it doesn't seem necessary.
ErrorDict is only ever populated by ValidationError.messages, which are all ErrorList instances and ErrorList knows how to print itself. How are you getting into a situation where this is not the case?