Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#14144 closed (fixed)

ModelMultipleChoiceField doesnt check validators

Reported by: ys Owned by: matiasb
Component: Forms Version: master
Severity: Keywords: ModelMultipleChoiceField, validators, clean
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

'clean' method is overloaded in ModelMultipleChoiceField but it doesnt call super().clean or run validators.

http://code.djangoproject.com/browser/django/trunk/django/forms/models.py#L1000

So when i pass 'validators=[aaa]' in init aaa is not called.

Attachments (1)

14144.diff (1.6 KB) - added by matiasb 5 years ago.
Patch and tests for ModelMultipleChoiceField clean method to run validators

Download all attachments as: .zip

Change History (5)

comment:1 Changed 5 years ago by matiasb

  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to matiasb
  • Patch needs improvement unset

Changed 5 years ago by matiasb

Patch and tests for ModelMultipleChoiceField clean method to run validators

comment:2 Changed 5 years ago by matiasb

  • Has patch set
  • Triage Stage changed from Unreviewed to Ready for checkin

comment:3 Changed 4 years ago by jezdez

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

(In [14886]) Fixed #14144 -- Made sure custom validators are called in ModelMultipleChoiceFields. Thanks, matiasb.

comment:4 Changed 4 years ago by jezdez

(In [14906]) [1.2.X] Fixed #14144 -- Made sure custom validators are called in ModelMultipleChoiceFields. Thanks, matiasb.

Backport from trunk (r14886).

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