Changeset 2492 in products


Ignore:
Timestamp:
Jun 7, 2010 11:05:41 AM (14 years ago)
Author:
mylan
Message:

#194: Fix bugs in register form, set CaptchaWidget? for the Captcha field.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.plonecaptchas/branches/plone4/quintagroup/plonecaptchas/browser/register.py

    r2488 r2492  
     1from zope.formlib import form 
    12from zope.interface import Interface 
    23from plone.app.users.browser.register import AddUserForm 
     
    2122        """Add captcha field to form_fields.""" 
    2223        ffields = super(CaptchaRegistrationForm, self).form_fields 
    23          
    24         return ffields and ffields + form.Fields(CaptchaSchema) or ffields 
     24        if len(ffields): 
     25            ffields = ffields + form.Fields(CaptchaSchema) 
     26            ffields["captcha"].custom_widget = CaptchaWidget 
     27        return ffields 
    2528 
    2629 
Note: See TracChangeset for help on using the changeset viewer.