adapt CaptchaExtender to CommentForm only.
svn path=/plone.app.discussion/trunk/; revision=28642
This commit is contained in:
parent
ef8e34adbb
commit
ffcd7d7a31
@ -17,6 +17,7 @@ from plone.z3cform.fieldsets import extensible
|
|||||||
from plone.z3cform.fieldsets.interfaces import IFormExtender
|
from plone.z3cform.fieldsets.interfaces import IFormExtender
|
||||||
|
|
||||||
from plone.app.discussion.comment import Comment
|
from plone.app.discussion.comment import Comment
|
||||||
|
from plone.app.discussion.browser.comments import CommentForm
|
||||||
|
|
||||||
class ICaptcha(Interface):
|
class ICaptcha(Interface):
|
||||||
captcha = schema.TextLine(title=u"Type the word 'human' in all capital letters.",
|
captcha = schema.TextLine(title=u"Type the word 'human' in all capital letters.",
|
||||||
@ -32,7 +33,7 @@ provideAdapter(Captcha)
|
|||||||
provideAdapter(AttributeAnnotations)
|
provideAdapter(AttributeAnnotations)
|
||||||
|
|
||||||
class CaptchaExtender(extensible.FormExtender):
|
class CaptchaExtender(extensible.FormExtender):
|
||||||
adapts(Interface, IDefaultBrowserLayer, Interface) # context, request, form
|
adapts(Interface, IDefaultBrowserLayer, CommentForm) # context, request, form
|
||||||
|
|
||||||
def __init__(self, context, request, form):
|
def __init__(self, context, request, form):
|
||||||
self.context = context
|
self.context = context
|
||||||
|
Loading…
Reference in New Issue
Block a user