Opened 12 years ago

Closed 12 years ago

#19951 closed Bug (fixed)

Avoid ValueError in admin when passing a string as PK for an inherited model with an integer PK field

Reported by: anonymous Owned by: Igor Támara
Component: contrib.admin Version: dev
Severity: Normal Keywords: admin inheritance integer PK
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

In the admin if the PK for an inherited model is passed an string an error 500 is raised, the resulting status_code should be 404, the Exception throws a ValueError.

For example if in the tests the SuperVillain class is tried to be accessed with a wrong PK, like abc, the status_code is 500 and it should be 404.

Change History (3)

comment:1 by Igor Támara, 12 years ago

Easy pickings: set
Has patch: set
Owner: changed from nobody to Igor Támara
Status: newassigned

comment:3 by Ramiro Morales <cramm0@…>, 12 years ago

Resolution: fixed
Status: assignedclosed

In e2ee02c5bd412a6a1b33353cac1a222be989d71f:

Fixed #19951 -- Admin: Invalid model PK values shouldn't cause 500 status.

Avoid ValueError in admin when passing a string as PK for an inherited
model with an integer PK field.

Thanks ikks for the patch. See also #11191.

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