content_type.views.shortcut throws exception handling invalid UUID (View on Site in admin)
I have a Django model with a UUID as a primary key. The model has a get_absolute_url
implemented, which means in the Django admin, there is a “View on Site” button on the instance detail view.
A valid “View on Site” request looks like this: /admin/r/2/b6a283ce-0529-4ce6-8aa8-3aa5eba4f95b/
, where the first parameter 2, is the content type ID, and the 2nd parameter is the UUID for a model instance. An invalid request looks like this: /admin/r/2/bad-uuid-that-will-not-validate/
.
If an invalid UUID is passed to this view, the view will raise an unhandled ValidationError on this line .
Because this view is used in the admin application, it requires a staff member to access, so it cannot be thrown by a standard or unathenticated user.
Change History
(12)
Type: |
Uncategorized → Bug
|
Triage Stage: |
Unreviewed → Accepted
|
Owner: |
set to Ahmed Nassar
|
Status: |
new → assigned
|
Patch needs improvement: |
set
|
Patch needs improvement: |
unset
|
Patch needs improvement: |
set
|
Patch needs improvement: |
unset
|
Patch needs improvement: |
set
|
Patch needs improvement: |
unset
|
Triage Stage: |
Accepted → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
Replicated. Thanks for the report!