It's not easy to attach a custom error message to a field that uses a Choice widget and a vocabulary
Bug #4576 reported by
Guilherme Salgado
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
Medium
|
Unassigned |
Bug Description
It'd be very handy if we could specify a custom message for each field, to be used whenever the user enters something that can't be find in the vocabulary. Right now, we'll always get a "Invalid value" message, which is far from good.
Changed in launchpad: | |
status: | New → Accepted |
Changed in launchpad: | |
assignee: | nobody → launchpad-infrastructure |
To post a comment you must log in.
Stuart suggested adding a custom validator to the Choice field that has the vocabulary, but that doesn't work because the call to SimpleInputWidg et.getInputValu e() will end up SingleDataHelpe r._toFieldValue (), which in turn calls ItemsWidgetBase .convertTokensT oValues( ), and this last call will raise a 'InvalidValue, "token %r not found in vocabulary" %token'.