From 8db9c8c175d26ff71fa4b42f12f38a67e6eedae8 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Sat, 17 Oct 2009 16:14:44 +0000 Subject: [PATCH] Removing hard coded publish action. evilbungle branch merge. svn path=/plone.app.discussion/trunk/; revision=30669 --- plone/app/discussion/browser/moderation.py | 3 +-- plone/app/discussion/tests/test_workflow.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/plone/app/discussion/browser/moderation.py b/plone/app/discussion/browser/moderation.py index d1961cd..46751e6 100644 --- a/plone/app/discussion/browser/moderation.py +++ b/plone/app/discussion/browser/moderation.py @@ -118,8 +118,7 @@ class PublishComment(BrowserView): comment = aq_inner(self.context) comment_id = self.context.id - #workflow_action = self.request.form['workflow_action'] - workflow_action = 'publish' + workflow_action = self.request.form['workflow_action'] portal_workflow = getToolByName(comment, 'portal_workflow') portal_workflow.doActionFor(comment, workflow_action) diff --git a/plone/app/discussion/tests/test_workflow.py b/plone/app/discussion/tests/test_workflow.py index ec8acb4..a2a08de 100644 --- a/plone/app/discussion/tests/test_workflow.py +++ b/plone/app/discussion/tests/test_workflow.py @@ -95,7 +95,7 @@ class TestCommentOperations(PloneTestCase): def test_publish(self): self.portal.REQUEST.form['comment_id'] = self.comment_id - self.portal.REQUEST.form['action'] = 'publish' + self.portal.REQUEST.form['workflow_action'] = 'publish' self.assertEquals('pending', self.portal.portal_workflow.getInfoFor(self.comment, 'review_state')) view = self.comment.restrictedTraverse('@@moderate-publish-comment') view() @@ -104,7 +104,7 @@ class TestCommentOperations(PloneTestCase): def test_publish_as_anonymous(self): self.logout() self.portal.REQUEST.form['comment_id'] = self.comment_id - self.portal.REQUEST.form['action'] = 'publish' + self.portal.REQUEST.form['workflow_action'] = 'publish' self.assertEquals('pending', self.portal.portal_workflow.getInfoFor(self.comment, 'review_state')) self.assertRaises(Unauthorized, self.comment.restrictedTraverse,