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
6
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.

Revision history for this message
Guilherme Salgado (salgado) wrote :

Stuart suggested adding a custom validator to the Choice field that has the vocabulary, but that doesn't work because the call to SimpleInputWidget.getInputValue() will end up SingleDataHelper._toFieldValue(), which in turn calls ItemsWidgetBase.convertTokensToValues(), and this last call will raise a 'InvalidValue, "token %r not found in vocabulary" %token'.

Dafydd Harries (daf)
Changed in launchpad:
status: New → Accepted
Dafydd Harries (daf)
Changed in launchpad:
assignee: nobody → launchpad-infrastructure
Revision history for this message
Curtis Hovey (sinzui) wrote :

We use setFieldError in LaunchpadFormView.validate()

Changed in launchpad-foundations:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.