Opened 10 years ago

Closed 8 years ago

#624 closed defect (fixed)

formfields.CheckboxSelectMultipleField validators are broken

Reported by: django@… Owned by: adrian
Component: Core (Other) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

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.

Kieran

Change History (1)

comment:1 Changed 8 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in newforms.

Note: See TracTickets for help on using tickets.
Back to Top