Skip to content

fix: AI moderation fields in accessible_fields#26

Merged
jcapphelix merged 1 commit intorelease-ulmofrom
chintanjoshi-apphelix-2u/feat-ai-moderation
Nov 5, 2025
Merged

fix: AI moderation fields in accessible_fields#26
jcapphelix merged 1 commit intorelease-ulmofrom
chintanjoshi-apphelix-2u/feat-ai-moderation

Conversation

@jcapphelix
Copy link

@jcapphelix jcapphelix commented Nov 4, 2025

Description

This PR adds a few fields in Comment and Thread to identify if content is spam. So manual efforts are reduced to remove the spam.

As of now it is just a MVP.

There are various changes supposed to be done on this.

Test Instructions

  • Install this forum on your devstack / environment (Open edX is on forum==0.3.8, edx/forum is on forum == 0.3.9)
  • Enable Ai Moderation waffle discussions.enable_ai_moderation
  • Set following in your environment files
AI_MODERATION_API_URL: 'URL_FOR_AI'
AI_MODERATION_CLIENT_ID: 'AI_CLIENT_ID'
AI_MODERATION_USER_ID: USER_ID_OF_GLOBAL_MODERATOR
  • Now try and create a spam / scam post, you should see it as reported (if you are a staff)
  • ModerationAuditLog in Django admin will also show you the spammed post

Related PRs and order of merging:-

  1. feat: AI moderation feature forum#1
  2. https://github.com/edx/sandbox-internal/pull/385
  3. https://github.com/edx/edx-internal/pull/13562
  4. https://github.com/edx/edx-internal/pull/13561
  5. fix: AI moderation fields in accessible_fields #26

Needs Migration command to be run

This PR adds new migration files so migration commands need to run if not run automatically

./manage.py lms migrate forum

Verification

  • To check if it's installed or not, you can go to your edxapp env in your desired environment and fire following :-
pip list | grep forum

This should list 0.3.9 as forum version

Known issues :-

Deadline :- ASAP

Jira Link

@jcapphelix jcapphelix mentioned this pull request Nov 4, 2025
5 tasks
@jcapphelix jcapphelix marked this pull request as ready for review November 4, 2025 09:50
Copilot AI review requested due to automatic review settings November 4, 2025 09:50
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds three new fields related to AI-powered content moderation to the accessible_fields list for both Thread and Comment models in the comment client layer.

  • Adds is_spam, ai_moderation_reason, and abuse_flagged fields to accessible_fields lists
  • Enables Thread and Comment objects to retrieve and store these moderation-related fields from the backend

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
openedx/core/djangoapps/django_comment_common/comment_client/thread.py Adds three AI moderation fields (is_spam, ai_moderation_reason, abuse_flagged) to the Thread model's accessible_fields list
openedx/core/djangoapps/django_comment_common/comment_client/comment.py Adds three AI moderation fields (is_spam, ai_moderation_reason, abuse_flagged) to the Comment model's accessible_fields list

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jcapphelix jcapphelix merged commit 90c6650 into release-ulmo Nov 5, 2025
70 checks passed
@jcapphelix jcapphelix deleted the chintanjoshi-apphelix-2u/feat-ai-moderation branch November 5, 2025 14:56
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.

3 participants