Esempio n. 1
0
def validate_swearwords(str):
    """Soft swear word filter to encourage contructive feedback."""
    matches = swearwords.find_swearwords(str)
    if matches:
        raise ValidationError(
            _('Your comment contains swear words (%s). In order to help us '
              'improve our products, please use words that help us create an '
              'action or to-do from your constructive feedback. Thanks!') % (
                ', '.join(matches)))
Esempio n. 2
0
def validate_swearwords(str):
    """Soft swear word filter to encourage contructive feedback."""
    matches = swearwords.find_swearwords(str)
    if matches:
        # L10n: "Swear words" are cuss words/offensive words.
        raise ValidationError(
            _('Your comment contains swear words (%s). In order to help us '
              'improve our products, please use words that help us create an '
              'action or to-do from your constructive feedback. Thanks!') % (
                ', '.join(matches)))
def validate_swearwords(str):
    """Soft swear word filter to encourage contructive feedback."""
    matches = swearwords.find_swearwords(str)
    if matches:
        statsd.incr('swearing.total')
        for match in matches:
            statsd.incr('swearing.%s' % match)
        # L10n: "Swear words" are cuss words/offensive words.
        raise ValidationError(
            _('Your comment contains swear words (%s). In order to help us '
              'improve our products, please use words that help us create an '
              'action or to-do from your constructive feedback. Thanks!') % (
                ', '.join(matches)))