This commit is contained in:
tisto
2012-01-14 07:13:39 +01:00
parent f520482eb3
commit a3883d7e7b
7 changed files with 25 additions and 22 deletions
+4 -3
View File
@@ -42,7 +42,8 @@ class CaptchaExtender(extensible.FormExtender):
registered when a plugin is installed that provides the
"plone.app.discussion-captcha" feature.
"""
adapts(Interface, IDefaultBrowserLayer, CommentForm) # context, request, form
# context, request, form
adapts(Interface, IDefaultBrowserLayer, CommentForm)
fields = Fields(ICaptcha)
@@ -66,10 +67,10 @@ class CaptchaExtender(extensible.FormExtender):
self.form.fields['captcha'].widgetFactory = CaptchaFieldWidget
elif self.captcha == 'recaptcha':
from plone.formwidget.recaptcha import ReCaptchaFieldWidget
self.form.fields['captcha'].widgetFactory = ReCaptchaFieldWidget
self.form.fields['captcha'].widgetFactory = \
ReCaptchaFieldWidget
elif self.captcha == 'norobots':
from collective.z3cform.norobots import NorobotsFieldWidget
self.form.fields['captcha'].widgetFactory = NorobotsFieldWidget
else:
self.form.fields['captcha'].mode = interfaces.HIDDEN_MODE
+2 -2
View File
@@ -66,14 +66,14 @@ class DiscussionSettingsEditForm(controlpanel.RegistryEditForm):
_(u"Moderator Email Notification")
self.widgets['user_notification_enabled'].label = \
_(u"User Email Notification")
@button.buttonAndHandler(_('Save'), name=None)
def handleSave(self, action):
data, errors = self.extractData()
if errors:
self.status = self.formErrorsMessage
return
changes = self.applyChanges(data)
self.applyChanges(data)
IStatusMessage(self.request).addStatusMessage(_(u"Changes saved"),
"info")
self.context.REQUEST.RESPONSE.redirect("@@discussion-settings")