Changeset 3257 in products for quintagroup.z3cform.captcha/trunk/quintagroup/z3cform/captcha/widget.py
- Timestamp:
- Aug 18, 2011 8:34:55 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.z3cform.captcha/trunk/quintagroup/z3cform/captcha/widget.py
r1960 r3257 9 9 from z3c.form.browser.text import TextWidget 10 10 11 12 class CaptchaError(BaseException): 13 def __init__(self, value): 14 self.value = value 15 def __str__(self): 16 return repr(self.value) 17 18 11 19 class CaptchaWidget(TextWidget): 12 20 13 21 def getCaptcha(self): 14 return self.form.context.getCaptcha() 22 try: 23 return self.form.context.getCaptcha() 24 except AttributeError: 25 raise CaptchaError('quintagroup.captcha.core not installed. ' 26 'Install quintagroup.captcha.core using Quickinstaller or Plone Control Panel') 15 27 16 28 def render(self):
Note: See TracChangeset
for help on using the changeset viewer.