Remove unnecessary imports from captcha.py.
svn path=/plone.app.discussion/trunk/; revision=37760
This commit is contained in:
parent
1a84b0b7b8
commit
2dbc337fc7
@ -6,29 +6,26 @@ from persistent import Persistent
|
|||||||
|
|
||||||
from Products.CMFCore.utils import getToolByName
|
from Products.CMFCore.utils import getToolByName
|
||||||
|
|
||||||
from z3c.form import interfaces, validator
|
from z3c.form import interfaces
|
||||||
from z3c.form.field import Fields
|
from z3c.form.field import Fields
|
||||||
|
|
||||||
from zope import interface, schema
|
from zope import interface
|
||||||
|
|
||||||
from zope.annotation import factory
|
from zope.annotation import factory
|
||||||
|
|
||||||
from zope.component import adapts, provideAdapter, queryUtility
|
from zope.component import adapts, queryUtility
|
||||||
from zope.publisher.interfaces.browser import IDefaultBrowserLayer
|
from zope.publisher.interfaces.browser import IDefaultBrowserLayer
|
||||||
|
|
||||||
from zope.interface import Interface, implements
|
from zope.interface import Interface
|
||||||
|
|
||||||
from plone.registry.interfaces import IRegistry
|
from plone.registry.interfaces import IRegistry
|
||||||
|
|
||||||
from plone.z3cform.fieldsets import extensible
|
from plone.z3cform.fieldsets import extensible
|
||||||
from plone.z3cform.fieldsets.interfaces import IFormExtender
|
|
||||||
|
|
||||||
from plone.app.discussion.browser.comments import CommentForm
|
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, ICaptcha
|
from plone.app.discussion.interfaces import IDiscussionSettings, ICaptcha
|
||||||
|
|
||||||
from plone.app.discussion.browser.validator import CaptchaValidator
|
|
||||||
|
|
||||||
|
|
||||||
class Captcha(Persistent):
|
class Captcha(Persistent):
|
||||||
"""Captcha input field.
|
"""Captcha input field.
|
||||||
@ -70,9 +67,6 @@ class CaptchaExtender(extensible.FormExtender):
|
|||||||
elif self.captcha == 'recaptcha':
|
elif self.captcha == 'recaptcha':
|
||||||
from plone.formwidget.recaptcha import ReCaptchaFieldWidget
|
from plone.formwidget.recaptcha import ReCaptchaFieldWidget
|
||||||
self.form.fields['captcha'].widgetFactory = ReCaptchaFieldWidget
|
self.form.fields['captcha'].widgetFactory = ReCaptchaFieldWidget
|
||||||
elif self.captcha == 'akismet':
|
else:
|
||||||
# Hide the captcha field and move the Akismet validator error
|
|
||||||
# message to the top
|
|
||||||
self.form.fields['captcha'].mode = interfaces.HIDDEN_MODE
|
self.form.fields['captcha'].mode = interfaces.HIDDEN_MODE
|
||||||
self.move('captcha', before='author_name', prefix='')
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user