Opened 15 years ago
Closed 15 years ago
#12348 closed (duplicate)
ForeignKeyRawIdWidget doesn't catch ObjectDoesNotExist when raw_id is illegal
Reported by: | jay | Owned by: | nobody |
---|---|---|---|
Component: | contrib.admin | Version: | 1.1 |
Severity: | Keywords: | ForeignKeyRawIdWidget | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
If a FK is referred raw_id_fields ModelAdmin, it will use ModelChoiceField with ForeignKeyRawIdWidget to render itself.
ForeignKeyRawIdWidget tests whether the value passed in the render() method is null to see if it has to call label_for_value to show the repr of the referred record. So if the value is faulty but not null, label_for_value will still be called, then ObjectDostNotExist will be thrown without any handling.
Attachments (1)
Change History (2)
by , 15 years ago
Attachment: | widgets.py.diff added |
---|
comment:1 by , 15 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Duplicate of #11465 that has an identical patch.