Ticket #6877: dj-label_suffix-fix.patch
File dj-label_suffix-fix.patch, 1.2 KB (added by , 16 years ago) |
---|
-
django/forms/forms.py
150 150 output.append(error_row % force_unicode(bf_errors)) 151 151 if bf.label: 152 152 label = conditional_escape(force_unicode(bf.label)) 153 # Only add the suffix if the label does not end in154 # punctuation.155 if self.label_suffix:156 if label[-1] not in ':?.!':157 label += self.label_suffix158 153 label = bf.label_tag(label) or '' 159 154 else: 160 155 label = '' … … 410 405 If attrs are given, they're used as HTML attributes on the <label> tag. 411 406 """ 412 407 contents = contents or conditional_escape(self.label) 408 # Only add the suffix if the label does not end in 409 # punctuation. 410 if self.form.label_suffix: 411 if contents[-1] not in ':?.!': 412 contents += self.form.label_suffix 413 413 414 widget = self.field.widget 414 415 id_ = widget.attrs.get('id') or self.auto_id 415 416 if id_: