Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple captcha #451

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Simple captcha #451

wants to merge 5 commits into from

Conversation

pppls
Copy link

@pppls pppls commented Oct 2, 2021

Thank you for contributing! Please follow the guidelines below to submit your
pull request. Additional details are available in our
Contributor Guide.

Description of change

I added a simple captcha, based on comments in issue #420. @vsalvino mentioned he found a good open-source captcha package to integrate (https://django-simple-captcha.readthedocs.io/en/latest/index.html) and I found wagtail variants in the form of
https://github.com/acarasimon96/wagtail-django-simple-captcha
and
https://github.com/springload/wagtail-django-recaptcha
The latter has implemented the bulk of the work, the former just makes it so that it works with simple-captcha rather than recaptcha.
I saw no easy way to import those existing package to integrate with coderedcms and rather opted to utilize their code directly (in the case of the CodeRedFormBuilder we could subclass it from WagtailCaptchaFormBuilder but I'm not sure if this is as trivial for the code in the CoderedFormPage class in the page_models file due to the fact that process_form_submission has been redefined somewhere earlier and because it does not subclass AbstractForm).

I have clearly marked which functions I am talking about but I would like input on how you prefer to reference their source code.

The functionality looks as follows:
image
and can be toggled via the spam_protection checkbox under settings.

Documentation

I added a small part that says the captcha will be created when toggling the spam_protection checkbox.

Tests

Due to not importing the packages themselves directly, we would need to copy the tests as well, but the structure of their testapp looks a bit different from what is being done in CodeRedCMS so I'm not sure to what extent I should copy it.

@vsalvino
Copy link
Contributor

vsalvino commented Jun 3, 2022

Thanks for doing this work. Since it's a bigger change it might take a while to be fully reviewed, but it's on our radar. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Awaiting Review Awaiting review and approval
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants