feat(discussion): Implement discussion moderation features #37816
+4,631
−35
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces comprehensive support for discussion moderation, focusing on user banning and improved permissions, as well as adding audit-friendly Django admin interfaces for discussion moderation models. Key changes include enforcing discussion bans at the API level, filtering banned users from course stats, providing admin UIs for bans and exceptions, and sending escalation emails on ban actions. Additionally, permissions logic for moderation actions has been clarified and extended.
Discussion Moderation and Banning:
lms/djangoapps/discussion/rest_api/api.py) [1] [2] [3] [4] [5] [6]DiscussionBanandDiscussionBanExceptionwith read-only access for staff and full access for superusers, supporting audit and compliance needs. (lms/djangoapps/discussion/admin.py)lms/djangoapps/discussion/rest_api/emails.py)Permissions and Moderation Improvements:
lms/djangoapps/discussion/rest_api/permissions.py) [1] [2]Serializer and Miscellaneous Updates:
lms/djangoapps/discussion/rest_api/serializers.py) [1] [2] [3]…user bansDescription
Describe what this pull request changes, and why. Include implications for people using this change.
Design decisions and their rationales should be documented in the repo (docstring / ADR), per
OEP-19, and can be
linked here.
Useful information to include:
"Developer", and "Operator".
changes.
Supporting information
Link to other information about the change, such as Jira issues, GitHub issues, or Discourse discussions.
Be sure to check they are publicly readable, or if not, repeat the information here.
Testing instructions
Please provide detailed step-by-step instructions for testing this change.
Deadline
"None" if there's no rush, or provide a specific date or event (and reason) if there is one.
Other information
Include anything else that will help reviewers and consumers understand the change.