summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorHisham Mahmood <hishammahmood41@gmail.com>2024-07-17 15:50:45 +0200
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2024-07-18 08:30:53 +0200
commitc3d3af8ea369e16263c8330b1745ba101d1c8d62 (patch)
tree0a80e5e7b92bffdb98ebe08691a083851165ccdc /django
parentfe9bf0cef50e8e97e76424df98fd841fdc211e94 (diff)
[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 85366fbca723c9b37d0ac9db1d44e3f1cb188db2. Backport of 182f262b15882649bbc39d769f9b721cf3660f6f from main.
Diffstat (limited to 'django')
-rw-r--r--django/contrib/admin/options.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
index 89985357eb..1248c2c0df 100644
--- a/django/contrib/admin/options.py
+++ b/django/contrib/admin/options.py
@@ -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))