From 0ba3bda0655338c7912a0bcb3d03cf50f41152fa Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Wed, 12 Aug 2009 19:20:18 +0000 Subject: [PATCH] unnecessary AttributeAnnotations removed. imports for captcha/recaptcha added. svn path=/plone.app.discussion/trunk/; revision=28745 --- plone/app/discussion/browser/captcha.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/plone/app/discussion/browser/captcha.py b/plone/app/discussion/browser/captcha.py index 36e216c..05c20ee 100644 --- a/plone/app/discussion/browser/captcha.py +++ b/plone/app/discussion/browser/captcha.py @@ -5,7 +5,6 @@ from z3c.form.field import Fields from zope import interface, schema from zope.annotation import factory -from zope.annotation.attribute import AttributeAnnotations from zope.component import adapts, provideAdapter, queryUtility from zope.publisher.interfaces.browser import IDefaultBrowserLayer @@ -21,6 +20,17 @@ from plone.app.discussion.browser.comments import CommentForm from plone.app.discussion.comment import Comment from plone.app.discussion.interfaces import IDiscussionSettings +try: + from plone.formwidget.captcha import CaptchaFieldWidget +except ImportError: + pass + +try: + from plone.formwidget.recaptcha import ReCaptchaFieldWidget +except ImportError: + pass + + class ICaptcha(Interface): captcha = schema.TextLine(title=u"Captcha", required=True) @@ -32,7 +42,6 @@ class Captcha(Persistent): Captcha = factory(Captcha) provideAdapter(Captcha) -provideAdapter(AttributeAnnotations) class CaptchaExtender(extensible.FormExtender): adapts(Interface, IDefaultBrowserLayer, CommentForm) # context, request, form