app_name = settings.APP_SHORT_NAME
answer_author = answer.author.username
question = answer.question
- question_title = question.title
+ question_title = html.mark_safe(question.title)
accepted_by = answer.nstate.accepted.by.username
{% enddeclare %}
app_name = settings.APP_SHORT_NAME
answer_author = answer.author.username
question = answer.question
- question_title = question.title
+ question_title = html.mark_safe(question.title)
safe_body = html.html2text(answer.html)
{% enddeclare %}
post_author = post.author.username
comment_author = comment.author
question_url = question.get_absolute_url()
- question_title = question.title
+ question_title = html.mark_safe(question.title)
safe_body = html.html2text(comment.comment)
{% enddeclare %}
parser.feed(s)
parser.close()
parser.generate()
- return parser.result
+ return mark_safe(parser.result)
def buildtag(name, content, **attrs):
return mark_safe('<%s %s>%s</a>' % (name, " ".join('%s="%s"' % i for i in attrs.items()), content))
for recipient, subject, html, text, media in messages:
msgRoot = MIMEMultipart('related')
- msgRoot.set_charset('utf-8')
+ #msgRoot.set_charset('utf-8')
msgRoot['Subject'] = subject
msgRoot['From'] = sender
msgRoot['To'] = '%s <%s>' % (recipient.username, recipient.email)
msgAlternative = MIMEMultipart('alternative')
msgRoot.attach(msgAlternative)
- msgAlternative.attach(MIMEText(text))
- msgAlternative.attach(MIMEText(html, 'html'))
+ msgAlternative.attach(MIMEText(text.encode('utf-8'), _charset='utf-8'))
+ msgAlternative.attach(MIMEText(html.encode('utf-8'), 'html', _charset='utf-8'))
for alias, location in media.items():
fp = open(location, 'rb')