Remove moderation_enabled setting from registry to avoid migration problems to 1.0RC1. Refs #11419.

svn path=/plone.app.discussion/branches/1.x/; revision=47031
This commit is contained in:
Timo Stollenwerk 2011-01-24 08:37:43 +00:00
parent f44cb442eb
commit 543b9d47c5
4 changed files with 39 additions and 33 deletions

View File

@ -1,6 +1,14 @@
Changelog
=========
1.0RC2 (2011-01-24)
-------------------
- Remove moderation_enabled setting from registry to avoid migration problems
to 1.0RC1. This fixes http://dev.plone.org/plone/ticket/11419.
[timo]
1.0RC1 (2011-01-22)
-------------------

View File

@ -45,8 +45,9 @@ class DiscussionSettingsEditForm(controlpanel.RegistryEditForm):
super(DiscussionSettingsEditForm, self).updateFields()
self.fields['globally_enabled'].widgetFactory = \
SingleCheckBoxFieldWidget
self.fields['moderation_enabled'].widgetFactory = \
SingleCheckBoxFieldWidget
# p.a.discussion > 2.0 only
#self.fields['moderation_enabled'].widgetFactory = \
# SingleCheckBoxFieldWidget
self.fields['anonymous_comments'].widgetFactory = \
SingleCheckBoxFieldWidget
self.fields['show_commenter_image'].widgetFactory = \
@ -65,14 +66,8 @@ class DiscussionSettingsEditForm(controlpanel.RegistryEditForm):
_(u"Moderator Email Notification")
self.widgets['user_notification_enabled'].label = \
_(u"User Email Notification")
# Hide the moderation_enabled widget. We need plone.app.controlpanel
# > 2.1b1 in order to make sure that the proper events are fired when
# the workflow for discussion items is changed in the types control
# panel. Though, Plone 3 and 4.0 ship with an older version of
# p.a.controlpanel that do not fire this event properly.
# http://dev.plone.org/plone/changeset/46270/plone.app.controlpanel/trunk
self.widgets['moderation_enabled'].mode = interfaces.HIDDEN_MODE
# p.a.discussion > 2.0 only
#self.widgets['moderation_enabled'].mode = interfaces.HIDDEN_MODE
@button.buttonAndHandler(_('Save'), name='save')
def handleSave(self, action):
@ -117,8 +112,9 @@ class DiscussionSettingsControlPanel(controlpanel.ControlPanelFormWrapper):
if 'one_state_workflow' not in wf and \
'comment_review_workflow' not in wf:
output.append("moderation_custom")
elif settings.moderation_enabled:
output.append("moderation_enabled")
# p.a.discussion > 2.0 only
#elif settings.moderation_enabled:
# output.append("moderation_enabled")
# Anonymous comments
if settings.anonymous_comments:

View File

@ -44,20 +44,21 @@ class IDiscussionSettings(Interface):
default=False,
)
moderation_enabled = schema.Bool(
title=_(u"label_moderation_enabled",
default="Enable comment moderation"),
description=_(u"help_moderation_enabled",
default=u"If selected, comments will enter a 'Pending' state "
"in which they are invisible to the public. A user "
"with the 'Review comments' permission ('Reviewer' or "
"'Manager') can approve comments to make them visible "
"to the public. If you want to enable a custom "
"comment workflow, you have to go to the types "
"control panel."),
required=False,
default=False,
)
# p.a.discussion > 2.0 only
# moderation_enabled = schema.Bool(
# title=_(u"label_moderation_enabled",
# default="Enable comment moderation"),
# description=_(u"help_moderation_enabled",
# default=u"If selected, comments will enter a 'Pending' state "
# "in which they are invisible to the public. A user "
# "with the 'Review comments' permission ('Reviewer' or "
# "'Manager') can approve comments to make them visible "
# "to the public. If you want to enable a custom "
# "comment workflow, you have to go to the types "
# "control panel."),
# required=False,
# default=False,
# )
text_transform = schema.Choice(

View File

@ -54,13 +54,14 @@ class RegistryTest(PloneTestCase):
self.assertEquals(self.registry['plone.app.discussion.interfaces.' +
'IDiscussionSettings.anonymous_comments'], False)
def test_moderation_enabled(self):
# Check globally_enabled record
self.failUnless('moderation_enabled' in IDiscussionSettings)
self.assertEquals(
self.registry['plone.app.discussion.interfaces.' +
'IDiscussionSettings.moderation_enabled'],
False)
# p.a.discussion > 2.0 only
# def test_moderation_enabled(self):
# # Check globally_enabled record
# self.failUnless('moderation_enabled' in IDiscussionSettings)
# self.assertEquals(
# self.registry['plone.app.discussion.interfaces.' +
# 'IDiscussionSettings.moderation_enabled'],
# False)
def test_text_transform(self):
self.failUnless('text_transform' in IDiscussionSettings)