unnecessary AttributeAnnotations removed.

imports for captcha/recaptcha added.

svn path=/plone.app.discussion/trunk/; revision=28745
This commit is contained in:
Timo Stollenwerk 2009-08-12 19:20:18 +00:00
parent 68e129dd76
commit 0ba3bda065

View File

@ -5,7 +5,6 @@ from z3c.form.field import Fields
from zope import interface, schema from zope import interface, schema
from zope.annotation import factory from zope.annotation import factory
from zope.annotation.attribute import AttributeAnnotations
from zope.component import adapts, provideAdapter, queryUtility from zope.component import adapts, provideAdapter, queryUtility
from zope.publisher.interfaces.browser import IDefaultBrowserLayer 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.comment import Comment
from plone.app.discussion.interfaces import IDiscussionSettings 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): class ICaptcha(Interface):
captcha = schema.TextLine(title=u"Captcha", captcha = schema.TextLine(title=u"Captcha",
required=True) required=True)
@ -32,7 +42,6 @@ class Captcha(Persistent):
Captcha = factory(Captcha) Captcha = factory(Captcha)
provideAdapter(Captcha) provideAdapter(Captcha)
provideAdapter(AttributeAnnotations)
class CaptchaExtender(extensible.FormExtender): class CaptchaExtender(extensible.FormExtender):
adapts(Interface, IDefaultBrowserLayer, CommentForm) # context, request, form adapts(Interface, IDefaultBrowserLayer, CommentForm) # context, request, form