Changeset 3443 in products


Ignore:
Timestamp:
Apr 20, 2012 1:36:28 PM (12 years ago)
Author:
vmaksymiv
Message:

fixed processing catpcha vocabulary

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.plonecaptchas/branches/captcha_provider/quintagroup/plonecaptchas/captcha.py

    r3442 r3443  
    3333    """ Extend captcha vocabulary with quintagroup.plonecaptchas""" 
    3434    terms = vocabularies.captcha_vocabulary(context)._terms 
     35    captchas = [t.value for t in terms] 
    3536 
    3637    adapters = getAdapters((context,), ICaptchaProvider) 
    3738    for name, adapter in adapters: 
    38         terms.append(SimpleTerm(value=name, 
    39                                 token=name, 
    40                                 title=name)) 
     39        if name and name not in captchas: 
     40            terms.append(SimpleTerm(value=name.lower(), 
     41                                    token=name.lower(), 
     42                                    title=name[0].upper()+name[1:])) 
    4143    return SimpleVocabulary(terms) 
Note: See TracChangeset for help on using the changeset viewer.