Revision 0b423952 snf-astakos-app/astakos/im/widgets.py
b/snf-astakos-app/astakos/im/widgets.py | ||
---|---|---|
37 | 37 |
from django.utils.safestring import mark_safe |
38 | 38 |
from django.utils import simplejson as json |
39 | 39 |
from django.utils.translation import ugettext as _ |
40 |
from django.template.loader import render_to_string |
|
40 | 41 |
|
41 | 42 |
from astakos.im.settings import RECAPTCHA_PUBLIC_KEY, RECAPTCHA_OPTIONS, \ |
42 | 43 |
RECAPTCHA_USE_SSL |
... | ... | |
48 | 49 |
recaptcha_conf = ('<script type="text/javascript">' |
49 | 50 |
'var RecaptchaOptions = %s' |
50 | 51 |
'</script>') % json.dumps(conf) |
52 |
custom_widget_html = render_to_string("im/captcha.html", |
|
53 |
{'conf': 'Bob'}) |
|
51 | 54 |
return mark_safe(recaptcha_conf + \ |
55 |
custom_widget_html + \ |
|
52 | 56 |
captcha.displayhtml(RECAPTCHA_PUBLIC_KEY, |
53 | 57 |
use_ssl=RECAPTCHA_USE_SSL)) |
54 | 58 |
|
Also available in: Unified diff