Fix UnicodeEncodeException errors when submitting tickets with non-ASCII characters. Thanks to gjedeer for the patch!

This commit is contained in:
Ross Poulton 2011-07-01 18:13:01 +10:00
parent 9cad876f71
commit 5a64c1bbad

View File

@ -17,6 +17,8 @@ try:
except ImportError:
from base64 import decodestring as b64decode
from django.utils.encoding import smart_str
def send_templated_mail(template_name, email_context, recipients, sender=None, bcc=None, fail_silently=False, files=None):
"""
send_templated_mail() is a warpper around Django's e-mail routines that
@ -251,6 +253,6 @@ def text_is_spam(text, request):
'comment_author': '',
}
return ak.comment_check(text, data=ak_data)
return ak.comment_check(smart_str(text), data=ak_data)
return False