Opened 7 years ago
Last modified 5 years ago
#28393 closed Cleanup/optimization
Add a helpful exception for invalid values passed to AutoField/FloatField/IntegerField. — at Version 3
Reported by: | Diederik van der Boor | Owned by: | Nick Pope |
---|---|---|---|
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: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
When a large model is updated and saved with invalid values,
Django produces a traceback deep within the ORM, with no clue
which field assignment caused the error.
Developers are faced with:
"TypeError: int() argument must be a string, a bytes-like object or a number, not 'tuple'"
This change displays the field name which makes spotting errors a lot easier.
Change History (3)
comment:1 by , 7 years ago
Description: | modified (diff) |
---|
comment:2 by , 7 years ago
Easy pickings: | unset |
---|---|
Patch needs improvement: | set |
Summary: | Make debugging of invalid values assignments to model fields easier → Add a helpful exception for invalid AutoField/IntegerField values |
Triage Stage: | Unreviewed → Accepted |
Type: | Uncategorized → Cleanup/optimization |
comment:3 by , 5 years ago
Description: | modified (diff) |
---|---|
Owner: | changed from | to
Patch needs improvement: | unset |
Status: | new → assigned |
Summary: | Add a helpful exception for invalid AutoField/IntegerField values → Add a helpful exception for invalid values passed to AutoField/FloatField/IntegerField. |
Version: | 1.11 → master |
Note:
See TracTickets
for help on using tickets.
New PR.