summaryrefslogtreecommitdiff
path: root/django/newforms/forms.py
diff options
context:
space:
mode:
authorBoulder Sprinters <boulder-sprinters@djangoproject.com>2007-04-27 20:21:28 +0000
committerBoulder Sprinters <boulder-sprinters@djangoproject.com>2007-04-27 20:21:28 +0000
commit3b479bfc563d3b3d768640ff5963947c56ee042b (patch)
tree2a7e3397d79244b516cef5268ee6f2df125ccf45 /django/newforms/forms.py
parentd0213969c226aa95d22b0f7ebf4bffef6fb20c48 (diff)
boulder-oracle-sprint: Merged to [5113]
git-svn-id: http://code.djangoproject.com/svn/django/branches/boulder-oracle-sprint@5114 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/newforms/forms.py')
-rw-r--r--django/newforms/forms.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/django/newforms/forms.py b/django/newforms/forms.py
index 3df7a9e834..9fafd20787 100644
--- a/django/newforms/forms.py
+++ b/django/newforms/forms.py
@@ -122,7 +122,14 @@ class BaseForm(StrAndUnicode):
else:
if errors_on_separate_row and bf_errors:
output.append(error_row % bf_errors)
- label = bf.label and bf.label_tag(escape(bf.label + ':')) or ''
+ if bf.label:
+ label = escape(bf.label)
+ # Only add a colon if the label does not end in punctuation.
+ if label[-1] not in ':?.!':
+ label += ':'
+ label = bf.label_tag(label) or ''
+ else:
+ label = ''
if field.help_text:
help_text = help_text_html % field.help_text
else: