formfields.CheckboxSelectMultipleField validators are broken
|Reported by:||django@…||Owned by:||adrian|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Trying to find a good way to validate that >=1 of 2 checkboxes in a group are selected, I have noticed that:
*CheckboxSelectMultipleField validators are broken because the renderer munges the field names such that validators do not receive any field data. This allows submission of arbitrary choice data because the default validator isValidChoice always passes.
*CheckboxField does not take the validator_list keyword argument - this prevents the first non-ideal solution that occured to me which would be to add RequiredIfOtherFieldNotGiven to the validator_list for one checkbox
Let me know if there is a built-in solution that I've missed.