Opened 8 years ago

Closed 8 years ago

#27904 closed New feature (fixed)

Add a system check that Field.validators are callable

Reported by: Adam Johnson Owned by: Adam Johnson
Component: Database layer (models, ORM) Version: dev
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 by Adam Johnson, 8 years ago

Owner: changed from nobody to Adam Johnson
Status: newassigned

comment:2 by Adam Johnson, 8 years ago

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

comment:3 by Tim Graham, 8 years ago

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 by Tim Graham <timograham@…>, 8 years ago

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