Opened 15 years ago

Closed 15 years ago

Last modified 13 years ago

#11607 closed (fixed)

ForeignKeyRawIdWidget render throws uncaught exception if value does not exist

Reported by: Joshua Russo Owned by: nobody
Component: contrib.admin Version: dev
Severity: Keywords: ForeignKeyRawIdWidget widget admin render uncaught exception
Cc: pete@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The label_for_value() method will (rightfully) throw an exception saying that the record does not exist if the user types a value that doesn't exist. The clean() method will have already caught the error but because of the uncaught exception in the render you never that.

Attachments (2)

fkrawidwidget.diff (644 bytes ) - added by Joshua Russo 15 years ago.
Placed a try catch around the retrieval of the label
11607.diff (2.8 KB ) - added by Peter Baumgartner 15 years ago.

Download all attachments as: .zip

Change History (7)

by Joshua Russo, 15 years ago

Attachment: fkrawidwidget.diff added

Placed a try catch around the retrieval of the label

comment:1 by Alex Gaynor, 15 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Peter Baumgartner, 15 years ago

Cc: pete@… added

Here's a patch (with test) that checks the exception being thrown.

by Peter Baumgartner, 15 years ago

Attachment: 11607.diff added

comment:3 by Joshua Russo, 15 years ago

milestone: 1.2

comment:4 by Karen Tracey, 15 years ago

Resolution: fixed
Status: newclosed

Fixed in r12648/r12649 for #11465. Wish I had found this ticket with test in the patch earlier.

comment:5 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

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