fix captcha factor not loading keys from Factor class

This commit is contained in:
Jens Langhammer 2019-03-08 20:08:28 +01:00
parent 296d4f691a
commit 2f7781b67a
1 changed files with 7 additions and 0 deletions

View File

@ -13,3 +13,10 @@ class CaptchaFactor(FormView, AuthenticationFactor):
def form_valid(self, form): def form_valid(self, form):
return self.authenticator.user_ok() 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