From 2f7781b67aa51e8cce5048a3a82da01043ad05c1 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Fri, 8 Mar 2019 20:08:28 +0100 Subject: [PATCH] fix captcha factor not loading keys from Factor class --- passbook/captcha_factor/factor.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/passbook/captcha_factor/factor.py b/passbook/captcha_factor/factor.py index a16222995..9ce564cff 100644 --- a/passbook/captcha_factor/factor.py +++ b/passbook/captcha_factor/factor.py @@ -13,3 +13,10 @@ class CaptchaFactor(FormView, AuthenticationFactor): def form_valid(self, form): return self.authenticator.user_ok() + + def get_form(self, form_class=None): + form = CaptchaForm(**self.get_form_kwargs()) + form.fields['captcha'].public_key = '6Lfi1w8TAAAAAELH-YiWp0OFItmMzvjGmw2xkvUN' + form.fields['captcha'].private_key = '6Lfi1w8TAAAAAMQI3f86tGMvd1QkcqqVQyBWI23D' + form.fields['captcha'].widget.attrs["data-sitekey"] = form.fields['captcha'].public_key + return form