Opened 3 years ago

Closed 3 years ago

#27904 closed New feature (fixed)

Add a system check that Field.validators are callable

Reported by: Adam (Chainz) Johnson Owned by: Adam (Chainz) Johnson
Component: Database layer (models, ORM) Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

Reading #27884 I thought that a system check could be added to ensure Field.validators is iterable, however it turns out that the refactoring in #27235 actually made it impossible to instantiate a field with validators not set to an iterable, as Field.__init__ now calls list on whatever the argument was.

However there is probably still value in a system check that iterates validators and ensures they are all callable, and possibly that they take one argument.

Change History (4)

comment:1 Changed 3 years ago by Adam (Chainz) Johnson

Owner: changed from nobody to Adam (Chainz) Johnson
Status: newassigned

comment:2 Changed 3 years ago by Adam (Chainz) Johnson

Summary: Add a field check for validatorsAdd a system check for Field.validators

comment:3 Changed 3 years ago by Tim Graham

Has patch: set
Patch needs improvement: set
Summary: Add a system check for Field.validatorsAdd a system check that Field.validators are callable
Triage Stage: UnreviewedAccepted

PR with comments for improvement.

comment:4 Changed 3 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In a452ddd:

Fixed #27904 -- Added a system check that Field.validators are callable.

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