feat: added soft delete functionality#83
Merged
Alam-2U merged 1 commit intorelease-ulmofrom Jan 14, 2026
Merged
Conversation
This was referenced Jan 12, 2026
There was a problem hiding this comment.
Pull request overview
This pull request implements soft delete functionality for discussion threads, responses, and comments using an is_deleted flag instead of permanently removing records. The implementation enables safe deletion and restoration of discussion content while preserving data integrity and providing moderation capabilities.
Changes:
- Added soft delete and restore functionality for threads, responses, and comments with audit trail (
is_deleted,deleted_at,deleted_byfields) - Implemented new API endpoints for restoring individual content and bulk restore operations
- Added support for viewing deleted content via
show_deletedquery parameter - Updated statistics tracking to count deleted content separately
- Modified all delete operations to track who performed the deletion
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| thread.py | Core soft delete implementation with restore methods and stats tracking for deleted content |
| models.py | Updated base delete method to accept and pass deleted_by parameter |
| comment.py | Added soft delete fields and restore methods for comments |
| views.py | Added RestoreContent, BulkRestoreUserPosts, and DeletedContentView endpoints |
| urls.py | Registered new restore and deleted content API routes |
| serializers.py | Added serialization for deletion-related fields with privilege-based visibility |
| forms.py | Added show_deleted field and BY_DELETED ordering option |
| tasks.py | Added restore_course_post_for_user async task for bulk operations |
| test files | Updated test expectations to include new deletion-related fields |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mraman-2U
approved these changes
Jan 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Implements soft delete functionality for discussion threads, responses, and comments using the
is_deletedflag instead of permanently deleting records.This enables safe deletion and restoration of discussion content while preserving existing data.
Changes Made
JIRA Tickets
Related Pull Requests