mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-05 03:00:15 -04:00
When api_type=json, return new captcha iden to caller when VCaptcha fails.
This commit is contained in:
@@ -70,6 +70,8 @@ class JsonResponse(object):
|
||||
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}
|
||||
|
||||
@@ -121,6 +123,9 @@ class JsonResponse(object):
|
||||
def _send_data(self, **kw):
|
||||
self._data.update(kw)
|
||||
|
||||
def new_captcha(self):
|
||||
self._new_captcha = True
|
||||
|
||||
|
||||
class JQueryResponse(JsonResponse):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user