diff options
| author | Tim Graham <timograham@gmail.com> | 2013-07-26 14:43:46 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-07-26 14:45:38 -0400 |
| commit | 8676318d2dae9a570d2314e4e6da8c00aaf2e2a0 (patch) | |
| tree | 86e3bd1bd11dd09d9aaf288357f9feacffb3d363 /django/contrib/admin | |
| parent | 2a979d2a7bec485e4b90b7ae99ace0dd16faa948 (diff) | |
Fixed #20805 -- Removed an extra colon beside checkboxes in the admin.
Thanks CollinAnderson for the report.
Diffstat (limited to 'django/contrib/admin')
| -rw-r--r-- | django/contrib/admin/helpers.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/django/contrib/admin/helpers.py b/django/contrib/admin/helpers.py index 3ffb85e6c6..b6d5bde932 100644 --- a/django/contrib/admin/helpers.py +++ b/django/contrib/admin/helpers.py @@ -125,14 +125,16 @@ class AdminField(object): contents = conditional_escape(force_text(self.field.label)) if self.is_checkbox: classes.append('vCheckboxLabel') - else: - contents += ':' + if self.field.field.required: classes.append('required') if not self.is_first: classes.append('inline') attrs = {'class': ' '.join(classes)} if classes else {} - return self.field.label_tag(contents=mark_safe(contents), attrs=attrs) + # checkboxes should not have a label suffix as the checkbox appears + # to the left of the label. + return self.field.label_tag(contents=mark_safe(contents), attrs=attrs, + label_suffix='' if self.is_checkbox else None) def errors(self): return mark_safe(self.field.errors.as_ul()) |
