[Django] #35903: "view on site" URL doesn't accept non-integer ContentType pks

10 views
Skip to first unread message

Django

unread,
Nov 11, 2024, 9:28:19 AM11/11/24
to django-...@googlegroups.com
#35903: "view on site" URL doesn't accept non-integer ContentType pks
-------------------------------------+-------------------------------------
Reporter: Tim | Owner: Tim Graham
Graham |
Type: | Status: assigned
Cleanup/optimization |
Component: | Version: 5.0
contrib.admin |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Most admin URL paths use the `path` converter to allow any type of ID,
however, the "view on site" uses the `int` converter for
`content_type_id`.

This doesn't work on MongoDB which uses `ObjectIdAutoField`
(`bson.ObjectId`) for all models since `AutoField` isn't supported.
--
Ticket URL: <https://code.djangoproject.com/ticket/35903>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 11, 2024, 9:30:02 AM11/11/24
to django-...@googlegroups.com
#35903: "view on site" URL doesn't accept non-integer ContentType pks
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: Tim
Type: | Graham
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 5.0
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* has_patch: 0 => 1

Comment:

[https://github.com/django/django/pull/18796 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/35903#comment:1>

Django

unread,
Nov 11, 2024, 9:37:01 AM11/11/24
to django-...@googlegroups.com
#35903: "view on site" URL doesn't accept non-integer ContentType pks
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: Tim
Type: | Graham
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* stage: Unreviewed => Accepted
* version: 5.0 => dev

Comment:

Thank you Tim for this report, I think your proposed solution makes sense
and it's a good improvement.
--
Ticket URL: <https://code.djangoproject.com/ticket/35903#comment:2>

Django

unread,
Nov 11, 2024, 10:50:49 AM11/11/24
to django-...@googlegroups.com
#35903: "view on site" URL doesn't accept non-integer ContentType pks
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: Tim
Type: | Graham
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/35903#comment:3>

Django

unread,
Nov 11, 2024, 10:53:42 AM11/11/24
to django-...@googlegroups.com
#35903: "view on site" URL doesn't accept non-integer ContentType pks
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: Tim
Type: | Graham
Cleanup/optimization | Status: closed
Component: contrib.admin | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce <42296566+sarahboyce@…>):

* resolution: => fixed
* status: assigned => closed

Comment:

In [changeset:"ef8ae06c2acd7b3673fee15b379213169153c7b0" ef8ae06c]:
{{{#!CommitTicketReference repository=""
revision="ef8ae06c2acd7b3673fee15b379213169153c7b0"
Fixed #35903 -- Made admin's "view on site" URL accept non-integer
ContentType pks.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35903#comment:4>
Reply all
Reply to author
Forward
0 new messages