[tor-commits] [bridgedb/master] add email domains to captcha template
arma at torproject.org
arma at torproject.org
Mon Sep 19 01:10:02 UTC 2011
commit 7a75aeede51179b657dc1d8521cbabdb24f631f5
Author: aagbsn <aagbsn at extc.org>
Date: Sun Sep 18 17:07:45 2011 -0700
add email domains to captcha template
---
lib/bridgedb/Server.py | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/lib/bridgedb/Server.py b/lib/bridgedb/Server.py
index 1089598..964506a 100644
--- a/lib/bridgedb/Server.py
+++ b/lib/bridgedb/Server.py
@@ -191,6 +191,11 @@ class WebResource(twisted.web.resource.Resource):
def buildHTMLMessageTemplateWithCaptcha(self, t, challenge, img):
"""Builds a translated html response with recaptcha"""
+ if self.domains:
+ email_domain_list = "<ul>" \
+ + "".join(("<li>%s</li>"%d for d in self.domains)) + "</ul>"
+ else:
+ email_domain_list = "<p>" + t.gettext(I18n.BRIDGEDB_TEXT[8]) + "</p>"
recaptchaTemplate = textwrap.dedent("""\
<form action="" method="POST">
@@ -225,6 +230,7 @@ class WebResource(twisted.web.resource.Resource):
+ "<p>" + t.gettext(I18n.BRIDGEDB_TEXT[9]) + "</p>" \
+ "<p>" + recaptchaTemplate + "</p>" \
+ "<p>" + t.gettext(I18n.BRIDGEDB_TEXT[4]) + "</p>" \
+ + email_domain_list \
+ "</body></html>"
return html_msg
More information about the tor-commits
mailing list