Esempio n. 1
0
    def GET_captchaimg(self, iden):
        """
        Request a CAPTCHA image given an `iden`.

        An iden is given as the `captcha` field with a `BAD_CAPTCHA`
        error, you should use this endpoint if you get a
        `BAD_CAPTCHA` error response.

        Responds with a 120x50 `image/png` which should be displayed
        to the user.

        The user's response to the CAPTCHA should be sent as `captcha`
        along with your request.

        To request a new CAPTCHA,
        use [/api/new_captcha](#POST_api_new_captcha).
        """
        image = captcha.get_image(iden)
        f = StringIO.StringIO()
        image.save(f, "PNG")
        response.content_type = "image/png;"
        return f.getvalue()
Esempio n. 2
0
    def GET_captchaimg(self, iden):
        """
        Request a CAPTCHA image given an `iden`.

        An iden is given as the `captcha` field with a `BAD_CAPTCHA`
        error, you should use this endpoint if you get a
        `BAD_CAPTCHA` error response.

        Responds with a 120x50 `image/png` which should be displayed
        to the user.

        The user's response to the CAPTCHA should be sent as `captcha`
        along with your request.

        To request a new CAPTCHA,
        use [/api/new_captcha](#POST_api_new_captcha).
        """
        image = captcha.get_image(iden)
        f = StringIO.StringIO()
        image.save(f, "PNG")
        response.content_type = "image/png;"
        return f.getvalue()
Esempio n. 3
0
 def GET_captchaimg(self, iden):
     image = captcha.get_image(iden)
     f = StringIO.StringIO()
     image.save(f, "PNG")
     return self.sendpng(f.getvalue())
Esempio n. 4
0
 def GET_captchaimg(self, iden):
     iden = re.sub("\.png$", "", iden, re.IGNORECASE)
     image = captcha.get_image(iden)
     f = StringIO.StringIO()
     image.save(f, "PNG")
     return self.sendpng(f.getvalue())
Esempio n. 5
0
 def GET_captchaimg(self, iden):
     image = captcha.get_image(iden)
     f = StringIO.StringIO()
     image.save(f, "PNG")
     return self.sendpng(f.getvalue())
Esempio n. 6
0
 def GET_captchaimg(self, iden):
     iden = re.sub("\.png$", "", iden, re.IGNORECASE)
     image = captcha.get_image(iden)
     f = StringIO.StringIO()
     image.save(f, "PNG")
     return self.sendpng(f.getvalue())
Esempio n. 7
0
 def GET_captchaimg(self, iden):
     image = captcha.get_image(iden)
     f = StringIO.StringIO()
     image.save(f, "PNG")
     response.content_type = "image/png;"
     return f.getvalue()