~ubuntu-branches/debian/squeeze/python-django/squeeze

« back to all changes in this revision

Viewing changes to django/contrib/comments/forms.py

  • Committer: Bazaar Package Importer
  • Author(s): Chris Lamb, Chris Lamb, David Spreen, Sandro Tosi
  • Date: 2008-11-19 21:31:00 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20081119213100-gp0lqhxl1qxa6dgl
Tags: 1.0.2-1
[ Chris Lamb ]
* New upstream bugfix release. Closes: #505783
* Add myself to Uploaders with ACK from Brett.

[ David Spreen ]
* Remove python-pysqlite2 from Recommends because Python 2.5 includes
  sqlite library used by Django. Closes: 497886

[ Sandro Tosi ]
* debian/control
  - switch Vcs-Browser field to viewsvn

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
from django.utils.encoding import force_unicode
12
12
from django.utils.hashcompat import sha_constructor
13
13
from django.utils.text import get_text_list
14
 
from django.utils.translation import ngettext
15
 
from django.utils.translation import ugettext_lazy as _
 
14
from django.utils.translation import ungettext, ugettext_lazy as _
16
15
 
17
16
COMMENT_MAX_LENGTH = getattr(settings,'COMMENT_MAX_LENGTH', 3000)
18
17
 
122
121
            bad_words = [w for w in settings.PROFANITIES_LIST if w in comment.lower()]
123
122
            if bad_words:
124
123
                plural = len(bad_words) > 1
125
 
                raise forms.ValidationError(ngettext(
 
124
                raise forms.ValidationError(ungettext(
126
125
                    "Watch your mouth! The word %s is not allowed here.",
127
126
                    "Watch your mouth! The words %s are not allowed here.", plural) % \
128
127
                    get_text_list(['"%s%s%s"' % (i[0], '-'*(len(i)-2), i[-1]) for i in bad_words], 'and'))