[tor-commits] [bridgedb/develop] Change ReCaptchaProtectedResource.render_POST() to call _renderDeferred().

isis at torproject.org isis at torproject.org
Wed Mar 26 05:49:31 UTC 2014


commit 454e0f7870575a362d1d162918519f1e1fda5179
Author: Isis Lovecruft <isis at torproject.org>
Date:   Tue Mar 25 22:30:19 2014 +0000

    Change ReCaptchaProtectedResource.render_POST() to call _renderDeferred().
    
     * FIXES #11218 (again).
---
 lib/bridgedb/HTTPServer.py |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/lib/bridgedb/HTTPServer.py b/lib/bridgedb/HTTPServer.py
index 4c5d414..d7b56b3 100644
--- a/lib/bridgedb/HTTPServer.py
+++ b/lib/bridgedb/HTTPServer.py
@@ -503,11 +503,15 @@ class ReCaptchaProtectedResource(CaptchaProtectedResource):
             ``'captcha_challenge_field'``, and the other,
             ``'captcha_response_field'``. These POST arguments should be
             obtained from :meth:`render_GET`.
-        :rtype: str
-        :returns: A rendered HTML page containing a ReCaptcha challenge image
-                  for the client to solve.
+        :returns: :api:`twisted.web.server.NOT_DONE_YET`, in order to handle
+            the ``Deferred`` returned from :meth:`checkSolution`. Eventually,
+            when the ``Deferred`` request is done being processed,
+            :meth:`_renderDeferred` will handle rendering and displaying the
+            HTML to the client.
         """
-        return CaptchaProtectedResource.render_POST(self, request)
+        d = self.checkSolution(request)
+        d.addCallback(self._renderDeferred)
+        return server.NOT_DONE_YET
 
 
 class WebResourceOptions(resource.Resource):





More information about the tor-commits mailing list