django / djangoproject.com

Source code to djangoproject.com
https://www.djangoproject.com/
BSD 3-Clause "New" or "Revised" License
1.86k stars 939 forks source link

Use django-contact-form's builtin AkismetContactForm #1559

Open bmispelon opened 4 days ago

bmispelon commented 4 days ago

The BaseContactForm in contact/forms.py has a custom clean_body() method that checks the message against the anti-spam service akismet. The docstring on that method seems to indicate that this method was copy/pasted from an old version of django-contact-form because the functionality was removed at some point.

However, it seems the functionality is builtin to the current version of django-contact-form: https://django-contact-form.readthedocs.io/en/latest/forms.html#django_contact_form.forms.AkismetContactForm

So we should be able to remove and simplify our code by using it.