Ejemplo n.º 1
0
 def make_response(self):
     res = {}
     if self._data:
         res['data'] = self._data
     if self._new_captcha:
         res['captcha'] = get_iden()
     res['errors'] = [(e[0], c.errors[e].message, e[1]) for e in self._errors]
     return {"json": res}
Ejemplo n.º 2
0
 def make_response(self):
     res = {}
     if self._data:
         res['data'] = self._data
     if self._new_captcha:
         res['captcha'] = get_iden()
     if self._ratelimit:
         res['ratelimit'] = self._ratelimit
     res['errors'] = [(e[0], c.errors[e].message, e[1]) for e in self._errors]
     return {"json": res}
Ejemplo n.º 3
0
 def make_response(self):
     res = {}
     if self._data:
         res["data"] = self._data
     if self._new_captcha:
         res["captcha"] = get_iden()
     if self._ratelimit:
         res["ratelimit"] = self._ratelimit
     res["errors"] = [(e[0], c.errors[e].message, e[1]) for e in self._errors]
     return {"json": res}
Ejemplo n.º 4
0
Archivo: pages.py Proyecto: vin/reddit
def get_captcha():
    if not c.user_is_loggedin or c.user.needs_captcha():
        return get_iden()
Ejemplo n.º 5
0
 def new_captcha(self):
     if not self._new_captcha:
         self.captcha(get_iden())
         self._new_captcha = True
Ejemplo n.º 6
0
 def new_captcha(self):
     if not self._new_captcha:
         self.captcha(get_iden())
         self._new_captcha = True
Ejemplo n.º 7
0
Archivo: api.py Proyecto: cmak/reddit
 def POST_new_captcha(self, res, *a, **kw):
     res.captcha = dict(iden = get_iden(), refresh = True)
Ejemplo n.º 8
0
 def _chk_captcha(self, err, err_on_thing = ''):
     if self._chk_error(err, err_on_thing):
         self.captcha = {'iden' : get_iden(), 'refresh' : True, 'id': err_on_thing}
         self._focus('captcha')
         return True
     return False
Ejemplo n.º 9
0
 def _chk_captcha(self, err):
     if self._chk_error(err):
         self.captcha = {'iden' : get_iden(), 'refresh' : True}
         self._focus('captcha')
Ejemplo n.º 10
0
def get_captcha():
    if not c.user_is_loggedin or c.user.needs_captcha():
        return get_iden()