Fix SMTP exception when an email is send to the moderator.
svn path=/plone.app.discussion/trunk/; revision=46013
This commit is contained in:
parent
e3eaef18b8
commit
b26d5a5a62
@ -4,6 +4,9 @@ Changelog
|
|||||||
1.0RC1 (unreleased)
|
1.0RC1 (unreleased)
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
|
- Fix SMTP exception when an email is send to the moderator.
|
||||||
|
[timo]
|
||||||
|
|
||||||
- Make sure comment UIDs in the catalog are always unique. This fixes
|
- Make sure comment UIDs in the catalog are always unique. This fixes
|
||||||
http://dev.plone.org/plone/ticket/10652.
|
http://dev.plone.org/plone/ticket/10652.
|
||||||
[timo]
|
[timo]
|
||||||
|
@ -307,11 +307,14 @@ def notify_moderator(obj, event):
|
|||||||
if PLONE_4:
|
if PLONE_4:
|
||||||
try:
|
try:
|
||||||
mail_host.send(message, mto, sender, subject, charset='utf-8')
|
mail_host.send(message, mto, sender, subject, charset='utf-8')
|
||||||
except SMTPException:
|
except SMTPException, e:
|
||||||
logger.error('SMTP exception while trying to send an ' +
|
logger.error('SMTP exception (%s) while trying to send an ' +
|
||||||
'email from %s to %s',
|
'email notification to the comment moderator ' +
|
||||||
|
'(from %s to %s, message: %s)',
|
||||||
|
e,
|
||||||
sender,
|
sender,
|
||||||
comment.author_email)
|
mto,
|
||||||
|
message)
|
||||||
else: # pragma: no cover
|
else: # pragma: no cover
|
||||||
try:
|
try:
|
||||||
mail_host.secureSend(message,
|
mail_host.secureSend(message,
|
||||||
@ -319,8 +322,11 @@ def notify_moderator(obj, event):
|
|||||||
sender,
|
sender,
|
||||||
subject=subject,
|
subject=subject,
|
||||||
charset='utf-8')
|
charset='utf-8')
|
||||||
except SMTPException:
|
except SMTPException, e:
|
||||||
logger.error('SMTP exception while trying to send an ' +
|
logger.error('SMTP exception (%s) while trying to send an ' +
|
||||||
'email from %s to %s',
|
'email notification to the comment moderator ' +
|
||||||
|
'(from %s to %s, message: %s)',
|
||||||
|
e,
|
||||||
sender,
|
sender,
|
||||||
comment.author_email)
|
mto,
|
||||||
|
message)
|
||||||
|
Loading…
Reference in New Issue
Block a user