Menu

#86 Form errors are cut off if they include a colon

2.1.2
closed
nobody
core
defect
normal
core
2.1.0
2013-12-30
2011-03-29
No

I'm using an EmailAddress validator within a FormEncode schema passed in to the @validate decorator. If an error with a colon in its message gets raised (e.g., "The domain portion of the email address is invalid (the portion after the @: foobar)"), then the error message in the form_errors dictionary gets cut after the colon (e.g., "The domain portion of the email address is invalid (the portion after the @").

I've tracked this down to line 332 of decoratedcontroller.py:

field_value = error.split(':')

This should instead be:

field_value = error.split(':', 1)

Discussion