﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
36267	content_type.views.shortcut throws exception handling invalid UUID (View on Site in admin)	Andy  Shapiro	Ahmed Nassar	"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 [https://github.com/django/django/blob/955b7c6ba105b328f387a9d63540dbabd4a05828/django/contrib/contenttypes/views.py#L21 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. "	Bug	closed	contrib.contenttypes	5.1	Normal	fixed			Ready for checkin	1	0	0	0	0	0
