예제 #1
0
 def GET(self):
     i = web.input()
     pols = get_pols(i)
     e = {}
     for pol in pols:
 	    e[pol] = has_captcha(pol) and writerep.prepare(pol) or dict(captcha_src=None)
     return e
예제 #2
0
 def GET(self):
     i = web.input()
     pols = get_pols(i)
     e = {}
     for pol in pols:
         e[pol] = has_captcha(pol) and writerep.prepare(pol) or dict(
             captcha_src=None)
     return e
예제 #3
0
def prepare_for_captcha(wf, pols=None):
    env = {}
    captcha_html = ''
    if not pols:
        address = (wf.addr1.value or '') + (wf.addr2.value or '')
    	pols = getpols(wf.zip5.value, wf.zip4.value, address)
    for pol in pols:
    	if has_captcha(pol):
    	    e = writerep.prepare(pol)
    	    if e:
                captcha_html += add_captcha(wf, e['captcha_src'], pol)
                env[pol] = e
    if env:
        wf.captcha_env.value = simplejson.dumps(env)
    return captcha_html