mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #20618 -- Fixed regression in BoundField.label_tag.
This commit is contained in:
@@ -518,9 +518,8 @@ class BoundField(object):
|
||||
"""
|
||||
contents = contents or self.label
|
||||
# Only add the suffix if the label does not end in punctuation.
|
||||
if self.form.label_suffix:
|
||||
if contents[-1] not in ':?.!':
|
||||
contents = format_html('{0}{1}', contents, self.form.label_suffix)
|
||||
if self.form.label_suffix and contents and contents[-1] not in ':?.!':
|
||||
contents = format_html('{0}{1}', contents, self.form.label_suffix)
|
||||
widget = self.field.widget
|
||||
id_ = widget.attrs.get('id') or self.auto_id
|
||||
if id_:
|
||||
|
||||
Reference in New Issue
Block a user