Skip to content

Delete kbforum and forum posts or threads created by user being deactivated #6742

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

Merged

Conversation

smithellis
Copy link
Contributor

No description provided.

@@ -57,6 +59,20 @@ def mark_content_as_spam(user, by_user):
for answer in Answer.objects.filter(creator=user):
answer.mark_as_spam(by_user)

# We will delete kbforums posts and threads
for thread in KBForumThread.objects.filter(creator=user):
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wouldn't add this here but rather in the view that handles the deactivation and the marking of spam

Copy link
Collaborator

Choose a reason for hiding this comment

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

Most probably you can use just filter here - probably contributors and kb forums won't have the same problem with AAQ

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @akatsoulas ! I'll revise.

Copy link
Collaborator

@akatsoulas akatsoulas left a comment

Choose a reason for hiding this comment

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

Looks good! Let's merge after the release. Please squash before merging

@smithellis smithellis merged commit 39e3151 into mozilla:main Jul 1, 2025
2 checks passed
@smithellis smithellis deleted the 2140-delete-kb-posts-for-deactivated-user branch July 1, 2025 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants