Opened 6 years ago

Closed 6 years ago

#29619 closed Cleanup/optimization (fixed)

Raised FieldError's should include the field that caused the error

Reported by: Alex Hayes Owned by: Jeff
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

Currently there are many places in django/db/models/sql/compiler.py that raise a FieldError however frustratingly the field that caused the error is not included.

I'm proposing that, where possible, all raised FieldError's raised should include, as part of the error message, the field that caused the error.

Change History (9)

comment:1 by Simon Charette, 6 years ago

Triage Stage: UnreviewedAccepted
Version: 2.0master

comment:2 by Jeff, 6 years ago

Owner: changed from nobody to Jeff
Status: newassigned

in reply to:  2 comment:3 by Shrey Batra, 6 years ago

Replying to Jeff:
Hello Jeff, I may be able to help you in patching this. Will you continue or could we work together?

comment:4 by Jeff, 6 years ago

Hi Shrey, sorry for the delay in getting back to you. I would still be happy to have you work on it with me if you are still interested.

comment:5 by Tim Graham, 6 years ago

Has patch: set
Patch needs improvement: set

PR (some test coverage is lacking)

comment:6 by Vishvajit Pathak, 6 years ago

Can I take this issue forward ? If yes then I would assign this issue to myself and will add the test cases required.

comment:7 by Simon Charette, 6 years ago

The new PR also requires adjustments.

comment:8 by Hasan Ramezani, 6 years ago

Patch needs improvement: unset

comment:9 by Tim Graham <timograham@…>, 6 years ago

Resolution: fixed
Status: assignedclosed

In 741ce81:

Fixed #29619 -- Added field names to some FieldErrors.

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