From db1fc5cd3c5d36cdb5d0fe4404efd6623dd3e8fb Mon Sep 17 00:00:00 2001 From: Jacob Rief Date: Wed, 4 Aug 2021 15:17:44 +0200 Subject: Fixed #32855 -- Corrected BoundWidget.id_for_label() with custom auto_id. --- django/forms/boundfield.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'django/forms') diff --git a/django/forms/boundfield.py b/django/forms/boundfield.py index 2ff8b0ee26..a061f15f87 100644 --- a/django/forms/boundfield.py +++ b/django/forms/boundfield.py @@ -277,7 +277,7 @@ class BoundWidget: @property def id_for_label(self): - return 'id_%s_%s' % (self.data['name'], self.data['index']) + return self.data['attrs'].get('id') @property def choice_label(self): -- cgit v1.3