#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)
Change History (7)
by , 16 years ago
| Attachment: | fkrawidwidget.diff added |
|---|
comment:1 by , 16 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:2 by , 16 years ago
| Cc: | added |
|---|
Here's a patch (with test) that checks the exception being thrown.
by , 16 years ago
| Attachment: | 11607.diff added |
|---|
comment:3 by , 16 years ago
| milestone: | → 1.2 |
|---|
comment:4 by , 16 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Fixed in r12648/r12649 for #11465. Wish I had found this ticket with test in the patch earlier.
Note:
See TracTickets
for help on using tickets.
Placed a try catch around the retrieval of the label