Revision 8998f09a snf-astakos-app/astakos/im/widgets.py
b/snf-astakos-app/astakos/im/widgets.py | ||
---|---|---|
38 | 38 |
from django.utils import simplejson as json |
39 | 39 |
from synnefo_branding.utils import render_to_string |
40 | 40 |
|
41 |
from astakos.im.settings import RECAPTCHA_PUBLIC_KEY, RECAPTCHA_OPTIONS, \ |
|
42 |
RECAPTCHA_USE_SSL |
|
41 |
from astakos.im import settings |
|
43 | 42 |
|
44 | 43 |
|
45 | 44 |
class RecaptchaWidget(forms.Widget): |
46 | 45 |
""" A Widget which "renders" the output of captcha.displayhtml """ |
47 | 46 |
def render(self, *args, **kwargs): |
48 |
conf = RECAPTCHA_OPTIONS |
|
47 |
conf = settings.RECAPTCHA_OPTIONS
|
|
49 | 48 |
recaptcha_conf = ('<script type="text/javascript">' |
50 | 49 |
'var RecaptchaOptions = %s' |
51 | 50 |
'</script>') % json.dumps(conf) |
... | ... | |
53 | 52 |
{'conf': 'Bob'}) |
54 | 53 |
return mark_safe(recaptcha_conf + |
55 | 54 |
custom_widget_html + |
56 |
captcha.displayhtml(RECAPTCHA_PUBLIC_KEY, |
|
57 |
use_ssl=RECAPTCHA_USE_SSL)) |
|
55 |
captcha.displayhtml(settings.RECAPTCHA_PUBLIC_KEY,
|
|
56 |
use_ssl=settings.RECAPTCHA_USE_SSL))
|
|
58 | 57 |
|
59 | 58 |
|
60 | 59 |
class DummyWidget(forms.Widget): |
Also available in: Unified diff