def render_GET(self, request): # get a captcha c = Raptcha(self.recaptchaPubKey, self.recaptchaPrivKey) c.get() # TODO: this does not work for versions of IE < 8.0 imgstr = 'data:image/jpeg;base64,%s' % base64.b64encode(c.image) return lookup.get_template('captcha.html').render(imgstr=imgstr, challenge_field=c.challenge)
def render_GET(self, request): if self.useRecaptcha: # get a captcha c = Raptcha(self.recaptchaPubKey, self.recaptchaPrivKey) c.get() # TODO: this does not work for versions of IE < 8.0 imgstr = 'data:image/jpeg;base64,%s' % base64.b64encode(c.image) HTML_CAPTCHA_TEMPLATE = self.buildHTMLMessageTemplateWithCaptcha( getLocaleFromRequest(request), c.challenge, imgstr) return HTML_CAPTCHA_TEMPLATE else: return self.getBridgeRequestAnswer(request)
def render_GET(self, request): if self.useRecaptcha: # get a captcha c = Raptcha(self.recaptchaPubKey, self.recaptchaPrivKey) c.get() # TODO: this does not work for versions of IE < 8.0 imgstr = "data:image/jpeg;base64,%s" % base64.b64encode(c.image) HTML_CAPTCHA_TEMPLATE = self.buildHTMLMessageTemplateWithCaptcha( getLocaleFromRequest(request), c.challenge, imgstr ) return HTML_CAPTCHA_TEMPLATE else: return self.getBridgeRequestAnswer(request)