Opened 17 years ago

Closed 17 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: 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)

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

Download all attachments as: .zip

Change History (4)

by Thomas Güttler <hv@…>, 17 years ago

comment:1 by Gary Wilson <gary.wilson@…>, 17 years ago

Needs tests: set
Triage Stage: UnreviewedAccepted

comment:2 by Malcolm Tredinnick, 17 years ago

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 by Thomas Güttler <hv@…>, 17 years ago

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