django-recaptcha in wizard forms #263
-
At the moment when used in form wizards, captcha becomes invalid on the last step. Any solution to this? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
Can you expand a bit more - is the captcha in the last step, or is it in an earlier step and then counts as invalid later? I can see the problem in the latter case, as presumably validation runs again when the whole form wizard is done and the captcha value can only be validated once. |
Beta Was this translation helpful? Give feedback.
-
This will be a problem regardless of what step you place the captcha on. (as the validation will run again at the end of the wizard anyway) |
Beta Was this translation helpful? Give feedback.
-
Isn't there something the field could do to work with wizards by caching the 'passed' state of the captcha after the first validation run? |
Beta Was this translation helpful? Give feedback.
-
Good suggestion. So it just locks to a validated state? Will look into it :) |
Beta Was this translation helpful? Give feedback.
-
I'm using django-formtools for a wizard and struggled with the same issue. I found the
And in your
This way only the ReCaptcha revalidation is skipped. If someone knows a better way to pass values from a view to a form field please post it here. |
Beta Was this translation helpful? Give feedback.
-
we solved the problem in a different way that does not use the https://github.com/uktrade/directory-ui-supplier/pull/337/files |
Beta Was this translation helpful? Give feedback.
we solved the problem in a different way that does not use the
sys._getframe()
hack.https://github.com/uktrade/directory-ui-supplier/pull/337/files