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

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

Open
bmispelon opened this issue Jun 26, 2024 · 6 comments
Open

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

bmispelon opened this issue Jun 26, 2024 · 6 comments
Assignees
Labels
good first issue Good for newcomers python Pull requests that update Python code

Comments

@bmispelon
Copy link
Member

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.

@bmispelon bmispelon added python Pull requests that update Python code good first issue Good for newcomers labels Jun 26, 2024
@Mayank-Raj-Nitp
Copy link

Sir, I would like to do this. Please assign the issue to me.

@bmispelon
Copy link
Member Author

Hi,

I've assigned you, but for reference you don't need to be assigned to an issue to work on it. It's enough to write a comment, so that others know you're working on it.

@ANISH-SR
Copy link

ANISH-SR commented Jul 12, 2024

Hello! I'm too working on this issue. Here's my current plan:

  1. Replace the custom 'clean_body()' method with the built-in 'AkismetContactForm' from the latest django-contact-form.
  2. Update the 'BaseContactForm' to inherit from 'AkismetContactForm'.
  3. Ensure all existing functionality is maintained, including custom fields and methods.
  4. Update the form initialization in views to pass the request object correctly.

I'll submit a pull request with these changes once I've implemented and tested them. If anyone has any suggestions or concerns, please let me know. I'm open to feedback and guidance, especially regarding maintaining compatibility with the rest of the project.

Is there anything else I should consider before proceeding?

@ANISH-SR
Copy link

ANISH-SR commented Jul 13, 2024

#1584 Hi @bmispelon, Could you please review this PR when you have a moment.
Thanks.
Edit: Really Sorry! for making the PR without addressing @MayankRaj-tech who is already assigned.

@RajuShivarama
Copy link

If the issue is still open, i would like to take it

@bmispelon
Copy link
Member Author

If the issue is still open, i would like to take it

Hi and thanks for your interest. The issue is still open yes, but you can see from the history of this issue that there's already two people working on it, and one open pull request (which has some broken automated tests that need fixing).

The best way forward would be to collaborate with the current contributors in order to fix the broken tests in the existing pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers python Pull requests that update Python code
Projects
None yet
Development

No branches or pull requests

4 participants