-
Notifications
You must be signed in to change notification settings - Fork 4
revert : "feat: soft delete" #78
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
Conversation
This reverts commit 1e8714f.
There was a problem hiding this 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 pull request reverts the soft delete feature (PR #37) for discussion posts, restoring the previous hard delete behavior. The revert removes soft delete functionality including the ability to mark content as deleted without permanently removing it, restore deleted content, and view deleted content metadata.
Key Changes:
- Removed soft delete methods (
soft_delete_thread,soft_delete_comments_of_a_thread) and restored hard delete operations - Eliminated
deleted_by,deleted_at,is_deleted, anddeleted_by_labelfields from models and serializers - Removed restore functionality including API endpoints, views, and associated tasks
- Removed
show_deletedquery parameter from forms and API calls
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| thread.py | Restored hard delete logic, removed soft delete methods and fields, simplified _delete_thread and delete_user_threads signatures |
| models.py | Removed deleted_by parameter from delete() method |
| comment.py | Removed soft delete fields from accessible_fields list and deleted restore methods |
| views.py | Removed RestoreContent, BulkRestoreUserPosts, and DeletedContentView classes, removed show_deleted parameter usage, removed triggered_by_user_id from event data |
| urls.py | Removed URL patterns for restore and deleted content endpoints |
| tasks.py | Removed restore_course_post_for_user task, simplified delete_course_post_for_user |
| serializers.py | Removed is_deleted, deleted_at, deleted_by, and deleted_by_label serializer fields and methods |
| forms.py | Removed show_deleted field from ThreadListGetForm and CommentListGetForm, removed BY_DELETED ordering option |
| test files | Updated expected response data to remove deleted_* fields |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import random | ||
| from datetime import datetime, timedelta | ||
| from unittest import mock | ||
| from urllib.parse import parse_qs, urlencode, urlparse, urlunparse |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'parse_qs' is not used.
Import of 'urlencode' is not used.
Import of 'urlparse' is not used.
Import of 'urlunparse' is not used.
| from urllib.parse import parse_qs, urlencode, urlparse, urlunparse |
| import ddt | ||
| import httpretty | ||
| import pytest | ||
| from django.test import override_settings |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'override_settings' is not used.
| from django.test import override_settings |
| from django.contrib.auth import get_user_model | ||
| from django.core.exceptions import ValidationError | ||
| from django.test.client import RequestFactory | ||
| from opaque_keys.edx.keys import CourseKey |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'CourseKey' is not used.
| from opaque_keys.edx.keys import CourseKey |
| SharedModuleStoreTestCase, | ||
| ) | ||
| from xmodule.modulestore.tests.factories import CourseFactory, BlockFactory | ||
| from xmodule.partitions.partitions import Group, UserPartition |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'Group' is not used.
Import of 'UserPartition' is not used.
| from xmodule.partitions.partitions import Group, UserPartition |
| make_minimal_cs_comment, | ||
| make_minimal_cs_thread, | ||
| ) | ||
| from openedx.core.djangoapps.course_groups.models import CourseUserGroupPartitionGroup |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'CourseUserGroupPartitionGroup' is not used.
| from openedx.core.djangoapps.course_groups.models import CourseUserGroupPartitionGroup |
Reverts #37