Opened 6 years ago

Closed 6 years ago

Last modified 6 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 6 years ago.
Patch and tests for ModelMultipleChoiceField clean method to run validators

Download all attachments as: .zip

Change History (5)

comment:1 Changed 6 years ago by matiasb

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

Changed 6 years ago by matiasb

Attachment: 14144.diff added

Patch and tests for ModelMultipleChoiceField clean method to run validators

comment:2 Changed 6 years ago by matiasb

Has patch: set
Triage Stage: UnreviewedReady for checkin

comment:3 Changed 6 years ago by Jannis Leidel

Resolution: fixed
Status: newclosed

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

comment:4 Changed 6 years ago by Jannis Leidel

(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