Running a project depending on this library with Django >= 3.0 with deprecation warnings activated (e.g. python -Wa manage.py test) shows the following warnings for wagtail-django-recaptcha:
[...]/lib/python3.8/site-packages/captcha/fields.py:26: RemovedInDjango40Warning: django.utils.translation.ugettext_lazy() is deprecated in favor of django.utils.translation.gettext_lazy().
"captcha_invalid": _("Error verifying reCAPTCHA, please try again."),
[...]/lib/python3.8/site-packages/captcha/fields.py:27: RemovedInDjango40Warning: django.utils.translation.ugettext_lazy() is deprecated in favor of django.utils.translation.gettext_lazy().
"captcha_error": _("Error verifying reCAPTCHA, please try again."),
Running a project depending on this library with Django >= 3.0 with deprecation warnings activated (e.g.
python -Wa manage.py test
) shows the following warnings forwagtail-django-recaptcha
:The solution is to simply remove the leading
u
in the method name, since that method is simply a alias forgettext_lazy
: https://docs.djangoproject.com/en/3.2/releases/3.0/#id3