Opened 12 years ago

Closed 12 years ago

#4387 closed (invalid)

newforms: ErrorDict.as_ul() needs to handle a list of errors

Reported by: Thomas Güttler <hv@…> Owned by: Adrian Holovaty
Component: Forms Version: master
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



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)

newformsutils-printerrordict.diff (778 bytes) - added by Thomas Güttler <hv@…> 12 years ago.

Download all attachments as: .zip

Change History (4)

Changed 12 years ago by Thomas Güttler <hv@…>

comment:1 Changed 12 years ago by Gary Wilson <gary.wilson@…>

Needs tests: set
Triage Stage: UnreviewedAccepted

comment:2 Changed 12 years ago by Malcolm Tredinnick

Needs tests: unset
Triage Stage: AcceptedUnreviewed

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?

comment:3 Changed 12 years ago by Thomas Güttler <hv@…>

Resolution: invalid
Status: newclosed

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.

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