Opened 9 years ago
Last modified 9 years ago
#27476 closed Bug
model Integer fields (and derivatives) do not raise a ValidationError while other types do — at Initial Version
| Reported by: | Romeo Mihalcea | Owned by: | nobody |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | 1.10 |
| Severity: | Normal | Keywords: | models, integer, ValidationError |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
I have a model with Decimal fields, Boolean fields and some Integer fields. While testing with invalid data (I mostly supplied a string to these fields) I noticed that the integer fields do not raise a ValidationError while all of the other fields do so. Supplying a string to all Integer fields raise a ValueError instead which looks like all other fields have a basic validation in place while the Integers do not. I know I'm supposed to perform the validations before the data reaches the model but this is testing and I like to make sure everything is as intended.