[Django] #35606: Admin changelist broken for model instances with __html__ method

13 views
Skip to first unread message

Django

unread,
Jul 16, 2024, 5:39:46 AM (yesterday) Jul 16
to django-...@googlegroups.com
#35606: Admin changelist broken for model instances with __html__ method
------------------------------+-------------------------------------------
Reporter: Claude Paroz | Type: Bug
Status: new | Component: contrib.admin
Version: 5.0 | Severity: Release blocker
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+-------------------------------------------
Since [85366fbca723c9b37d0ac9db1d44e3f1cb188db2] (#34045), any model
instance implementing an `__html__` method producing HTML markup is
breaking the admin, because of the aria-label property will contain
unescaped quotes that will break the page HTML.

Maybe the solution is forcing `str(obj)` in the `format_html` call.
--
Ticket URL: <https://code.djangoproject.com/ticket/35606>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 16, 2024, 5:58:56 AM (yesterday) Jul 16
to django-...@googlegroups.com
#35606: Admin changelist broken for model instances with __html__ method
---------------------------------+------------------------------------
Reporter: Claude Paroz | Owner: (none)
Type: Bug | Status: new
Component: contrib.admin | Version: 5.0
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------
Changes (by Sarah Boyce):

* stage: Unreviewed => Accepted

Comment:

Thank you! Replicated

> Maybe the solution is forcing `str(obj)` in the `format_html` call.

I think this works 👍
--
Ticket URL: <https://code.djangoproject.com/ticket/35606#comment:1>

Django

unread,
Jul 16, 2024, 8:46:32 PM (23 hours ago) Jul 16
to django-...@googlegroups.com
#35606: Admin changelist broken for model instances with __html__ method
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: Hisham
| Mahmood
Type: Bug | Status: assigned
Component: contrib.admin | Version: 5.0
Severity: Release blocker | 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 Hisham Mahmood):

* has_patch: 0 => 1
* owner: (none) => Hisham Mahmood
* status: new => assigned

Comment:

[https://github.com/django/django/pull/18374 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/35606#comment:2>

Django

unread,
Jul 16, 2024, 8:53:29 PM (22 hours ago) Jul 16
to django-...@googlegroups.com
#35606: Admin changelist broken for model instances with __html__ method
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: Hisham
| Mahmood
Type: Bug | Status: assigned
Component: contrib.admin | Version: 5.0
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Hisham Mahmood):

* needs_better_patch: 0 => 1

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

Django

unread,
Jul 16, 2024, 9:10:24 PM (22 hours ago) Jul 16
to django-...@googlegroups.com
#35606: Admin changelist broken for model instances with __html__ method
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: Hisham
| Mahmood
Type: Bug | Status: assigned
Component: contrib.admin | Version: 5.0
Severity: Release blocker | 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 Hisham Mahmood):

* needs_better_patch: 1 => 0

--
Ticket URL: <https://code.djangoproject.com/ticket/35606#comment:4>

Django

unread,
3:35 AM (16 hours ago) 3:35 AM
to django-...@googlegroups.com
#35606: Admin changelist broken for model instances with __html__ method
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: Hisham
| Mahmood
Type: Bug | Status: assigned
Component: contrib.admin | Version: 5.0
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* needs_better_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/35606#comment:5>

Django

unread,
10:31 AM (9 hours ago) 10:31 AM
to django-...@googlegroups.com
#35606: Admin changelist broken for model instances with __html__ method
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: Hisham
| Mahmood
Type: Bug | Status: assigned
Component: contrib.admin | Version: 5.0
Severity: Release blocker | 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):

* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/35606#comment:6>
Reply all
Reply to author
Forward
0 new messages