1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[5.0.x] Fixed #35606, Refs #34045 -- Fixed rendering of ModelAdmin.action_checkbox for models with a __html__ method.

Thank you Claude Paroz for the report.

Regression in 85366fbca7.

Backport of 182f262b15 from main.
This commit is contained in:
Hisham Mahmood
2024-07-17 15:50:45 +02:00
committed by Sarah Boyce
parent fe9bf0cef5
commit c3d3af8ea3
6 changed files with 50 additions and 2 deletions

View File

@@ -996,7 +996,9 @@ class ModelAdmin(BaseModelAdmin):
"""
attrs = {
"class": "action-select",
"aria-label": format_html(_("Select this object for an action - {}"), obj),
"aria-label": format_html(
_("Select this object for an action - {}"), str(obj)
),
}
checkbox = forms.CheckboxInput(attrs, lambda value: False)
return checkbox.render(helpers.ACTION_CHECKBOX_NAME, str(obj.pk))