From de4353641bde7ae4127246d15873f12e03490003 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Wed, 2 Feb 2011 19:55:24 +0000 Subject: [PATCH] Do not check for a comment review workflow when sending out a moderator email notification. This fixes http://dev.plone.org/plone/ticket/11444. Refs #11444 svn path=/plone.app.discussion/branches/1.x/; revision=47189 --- CHANGES.txt | 4 ++++ plone/app/discussion/comment.py | 7 ------- plone/app/discussion/tests/test_notifications.py | 13 ------------- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 2b64f00..9a6ff51 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,6 +4,10 @@ Changelog 1.0 (2011-01-24) ---------------- +- Do not check for a comment review workflow when sending out a moderator email + notification. This fixes http://dev.plone.org/plone/ticket/11444. + [timo] + - Check if the current user has configured an e-mail address for the email notification option. This fixes http://dev.plone.org/plone/ticket/11428. [timo] diff --git a/plone/app/discussion/comment.py b/plone/app/discussion/comment.py index d66a6bb..f89f02a 100644 --- a/plone/app/discussion/comment.py +++ b/plone/app/discussion/comment.py @@ -284,13 +284,6 @@ def notify_moderator(obj, event): if not settings.moderator_notification_enabled: return - # Check if the current workflow implements a pending state. - wf_tool = getToolByName(obj, 'portal_workflow') - comment_workflow = wf_tool.getChainForPortalType('Discussion Item')[0] - comment_workflow = wf_tool[comment_workflow] - if 'pending' not in comment_workflow.states: - return - # Get informations that are necessary to send an email mail_host = getToolByName(obj, 'MailHost') portal_url = getToolByName(obj, 'portal_url') diff --git a/plone/app/discussion/tests/test_notifications.py b/plone/app/discussion/tests/test_notifications.py index ae78ac4..86b05ad 100644 --- a/plone/app/discussion/tests/test_notifications.py +++ b/plone/app/discussion/tests/test_notifications.py @@ -256,18 +256,5 @@ class TestModeratorNotificationUnit(PloneTestCase): self.conversation.addComment(comment) self.assertEquals(len(self.mailhost.messages), 0) - def test_do_not_notify_moderator_when_moderation_workflow_is_disabled(self): - # Disable comment moderation and make sure no email is send to the - # moderator. - self.portal.portal_types['Document'].allow_discussion = True - self.portal.portal_workflow.setChainForPortalTypes( - ('Discussion Item',), - ('one_state_workflow',)) - - comment = createObject('plone.Comment') - comment.text = 'Comment text' - self.conversation.addComment(comment) - self.assertEquals(len(self.mailhost.messages), 0) - def test_suite(): return unittest.defaultTestLoader.loadTestsFromName(__name__)