Simplify the CaptchaValidator class by dynamically adapting a view with the name of the captcha plugin (e.g. recaptcha, captcha, akismet) for the validator.
svn path=/plone.app.discussion/trunk/; revision=37131
This commit is contained in:
@@ -119,7 +119,11 @@ class CommentForm(extensible.ExtensibleForm, form.Form):
|
||||
if 'captcha' in data:
|
||||
# Check Captcha only if there is a value, otherwise
|
||||
# the default "required" validator is sufficient.
|
||||
captcha = CaptchaValidator(self.context, self.request, None, ICaptcha['captcha'], None)
|
||||
captcha = CaptchaValidator(self.context,
|
||||
self.request,
|
||||
None,
|
||||
ICaptcha['captcha'],
|
||||
None)
|
||||
captcha.validate(data['captcha'])
|
||||
else:
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user