Skip to content

Commit

Permalink
Compatibility with latest django-recaptcha
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Feb 15, 2024
1 parent 48b2ad5 commit 02ab10b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Change log
Next version
------------

* Raised the minimum django-recaptcha version to 4.0.

0.23
----

Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ ReCaptcha
=========

To enable [ReCaptcha](http://www.google.com/recaptcha) install
[django-recaptcha](https://github.com/praekelt/django-recaptcha) and add
`captcha` to your `INSTALLED_APPS`. This will automatically add a ReCaptcha
[django-recaptcha](https://github.com/django-recaptcha/django-recaptcha) and add
`django_recaptcha` to your `INSTALLED_APPS`. This will automatically add a ReCaptcha
field to the form designer. For everything else read through the
django-recaptcha readme.

Expand Down
6 changes: 3 additions & 3 deletions form_designer/default_field_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ def require_choices(field):
]

# Add recaptcha field if available
if apps.is_installed("captcha"): # pragma: no cover
if apps.is_installed("django_recaptcha"): # pragma: no cover
try:
from captcha.fields import ReCaptchaField
from captcha.widgets import ReCaptchaV2Checkbox, ReCaptchaV3
from django_recaptcha.fields import ReCaptchaField
from django_recaptcha.widgets import ReCaptchaV2Checkbox, ReCaptchaV3
except ImportError:
pass
else:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dependencies = [
tests = [
"coverage",
"django-mptt",
"django-recaptcha",
"django-recaptcha>=4",
"FeinCMS",
]
[project.urls]
Expand Down

4 comments on commit 02ab10b

@agouliel
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beginning lines of a view that uses a form:

from django.shortcuts import render, get_object_or_404, HttpResponseRedirect
from form_designer.models import Form

def myview(request):
    instance = get_object_or_404(Form, pk=1)

@matthiask
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@agouliel are you trying to report an issue or incompatibility?

@agouliel
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matthiask no, this was just a comment to remind me in the future how to use the package. These lines should be in the README, in my opinion.

@matthiask
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@agouliel Alright. Feel free to propose improvements to the docs in a pull request, much low hanging fruit there I'm sure!

Please sign in to comment.