[tor-commits] [bridgedb/master] Use txrecaptcha in bridgedb.HTTPServer.ReCaptchaProtectedResource.

isis at torproject.org isis at torproject.org
Sun Mar 16 19:04:58 UTC 2014


commit d3ebc3c2d49a008608ab962fdd1ddd7de53ecb21
Author: Isis Lovecruft <isis at torproject.org>
Date:   Wed Mar 12 06:55:14 2014 +0000

    Use txrecaptcha in bridgedb.HTTPServer.ReCaptchaProtectedResource.
---
 lib/bridgedb/HTTPServer.py |    7 ++++---
 lib/bridgedb/captcha.py    |    3 ++-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/lib/bridgedb/HTTPServer.py b/lib/bridgedb/HTTPServer.py
index 05315de..49700c5 100644
--- a/lib/bridgedb/HTTPServer.py
+++ b/lib/bridgedb/HTTPServer.py
@@ -26,13 +26,14 @@ import bridgedb.Dist
 import bridgedb.I18n as I18n
 import bridgedb.Util as Util
 
-from recaptcha.client import captcha as recaptcha
 from bridgedb import captcha
 from bridgedb import crypto
 from bridgedb.Filters import filterBridgesByIP6, filterBridgesByIP4
 from bridgedb.Filters import filterBridgesByTransport
 from bridgedb.Filters import filterBridgesByNotBlockedIn
 from bridgedb.parse import headers
+from bridgedb import txrecaptcha
+
 from ipaddr import IPv4Address, IPv6Address
 from random import randint
 import mako.exceptions
@@ -423,8 +424,8 @@ class ReCaptchaProtectedResource(CaptchaProtectedResource):
         challenge, response = self.extractClientSolution(request)
         clientIP = self.getClientIP(request)
         remoteIP = self.getRemoteIP()
-        solution = recaptcha.submit(challenge, response,
-                                    self.recaptchaPrivKey, remoteIP)
+        solution = txrecaptcha.submit(challenge, response,
+                                      self.recaptchaPrivKey, remoteIP)
         logging.debug("Captcha from %r. Parameters: %r"
                       % (Util.logSafely(clientIP), request.args))
 
diff --git a/lib/bridgedb/captcha.py b/lib/bridgedb/captcha.py
index e508d21..e5bf5e5 100644
--- a/lib/bridgedb/captcha.py
+++ b/lib/bridgedb/captcha.py
@@ -41,10 +41,11 @@ import os
 import urllib2
 
 from BeautifulSoup import BeautifulSoup
-from recaptcha.client.captcha import API_SSL_SERVER
+
 from zope.interface import Interface, Attribute, implements
 
 from bridgedb import crypto
+from bridgedb.txrecaptcha import API_SSL_SERVER
 
 
 class ReCaptchaKeyError(Exception):





More information about the tor-commits mailing list