Opened 8 years ago
Closed 6 years ago
#28393 closed Cleanup/optimization (fixed)
Add a helpful exception for invalid values passed to AutoField/FloatField/IntegerField.
| 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 (4)
comment:1 by , 8 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 8 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 , 6 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.