Skip to content

Conversation

@jcapphelix
Copy link

Reverts #37

Copilot AI review requested due to automatic review settings January 7, 2026 15:19
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 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, and deleted_by_label fields from models and serializers
  • Removed restore functionality including API endpoints, views, and associated tasks
  • Removed show_deleted query 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
Copy link

Copilot AI Jan 7, 2026

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.

Suggested change
from urllib.parse import parse_qs, urlencode, urlparse, urlunparse

Copilot uses AI. Check for mistakes.
import ddt
import httpretty
import pytest
from django.test import override_settings
Copy link

Copilot AI Jan 7, 2026

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.

Suggested change
from django.test import override_settings

Copilot uses AI. Check for mistakes.
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
Copy link

Copilot AI Jan 7, 2026

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.

Suggested change
from opaque_keys.edx.keys import CourseKey

Copilot uses AI. Check for mistakes.
SharedModuleStoreTestCase,
)
from xmodule.modulestore.tests.factories import CourseFactory, BlockFactory
from xmodule.partitions.partitions import Group, UserPartition
Copy link

Copilot AI Jan 7, 2026

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.

Suggested change
from xmodule.partitions.partitions import Group, UserPartition

Copilot uses AI. Check for mistakes.
make_minimal_cs_comment,
make_minimal_cs_thread,
)
from openedx.core.djangoapps.course_groups.models import CourseUserGroupPartitionGroup
Copy link

Copilot AI Jan 7, 2026

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.

Suggested change
from openedx.core.djangoapps.course_groups.models import CourseUserGroupPartitionGroup

Copilot uses AI. Check for mistakes.
@Alam-2U Alam-2U merged commit e434680 into release-ulmo Jan 7, 2026
70 checks passed
@Alam-2U Alam-2U deleted the revert-37-cjoshi/feat-COSMO2-742 branch January 7, 2026 16:07
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