Skip to content

feat: soft delete#4

Merged
Alam-2U merged 1 commit intomasterfrom
cjoshi/feat-COSMO2-742
Jan 6, 2026
Merged

feat: soft delete#4
Alam-2U merged 1 commit intomasterfrom
cjoshi/feat-COSMO2-742

Conversation

@jcapphelix
Copy link
Collaborator

@jcapphelix jcapphelix commented Nov 17, 2025

Description

Implements soft delete functionality for discussion threads, responses, and comments using the is_deleted flag instead of permanently deleting records.
This enables safe deletion and restoration of discussion content while preserving existing data.


Changes Made

  • Added soft delete and restore functionality for threads, responses, and comments.
  • Introduced support to view deleted content in the Learner tab using a new Active / Deleted filter.
  • Implemented restore actions for deleted threads, responses, and comments.
  • Added deleted count tracking and support for sorting by deleted count in the Learner tab.
  • Implemented bulk delete and bulk restore actions for discussion content.
  • Ensured nested responses and comments are handled correctly during delete and restore operations.
  • Added API support to fetch deleted content for moderation workflows.

Note:
Features listed above (except soft delete itself) are available only to Staff, Admins, Moderators, and TAs.


JIRA Tickets

  • COSMO2-742Link
  • COSMO2-769Link
  • COSMO2-783Link

Related Pull Requests

Merge checklist:
Check off if complete or not applicable:

  • Version bumped
  • Documentation updated (not only docstrings)
  • Fixup commits are squashed away
  • Unit tests added/updated

@jcapphelix jcapphelix force-pushed the cjoshi/feat-COSMO2-742 branch from 959218b to ac1f216 Compare December 15, 2025 09:34
@jcapphelix jcapphelix marked this pull request as ready for review December 18, 2025 18:08
Copilot AI review requested due to automatic review settings December 18, 2025 18:08

This comment was marked as resolved.

Copilot AI review requested due to automatic review settings December 19, 2025 13:15

This comment was marked as resolved.

@jcapphelix jcapphelix force-pushed the cjoshi/feat-COSMO2-742 branch from e4e8678 to de02bda Compare December 19, 2025 13:32
@Alam-2U Alam-2U self-requested a review January 6, 2026 07:21
@Alam-2U Alam-2U merged commit 8f6699d into master Jan 6, 2026
13 checks passed
@Alam-2U Alam-2U deleted the cjoshi/feat-COSMO2-742 branch January 6, 2026 13:26
jcapphelix added a commit that referenced this pull request Jan 7, 2026
Alam-2U pushed a commit that referenced this pull request Jan 7, 2026
mraman-2U added a commit that referenced this pull request Feb 10, 2026
feat(discussion): Refactor ban and unban API views, models, and tests

test(discussion): remove duplicate MySQL test_discussion_ban_models.py

style: fix trailing whitespace and long lines in ban files

- Remove trailing whitespace from forum/api/bans.py and forum/views/bans.py
- Break long lines to meet 120 character limit
- Add mypy ignore_errors for ban-related modules (type annotations needed)

style: fix trailing whitespace and long lines in ban files

- Remove trailing whitespace from forum/api/bans.py and forum/views/bans.py
- Break long lines to meet 120 character limit
- Add mypy ignore_errors for ban-related modules (type annotations needed)

Revert "style: fix trailing whitespace and long lines in ban files"

This reverts commit 9f0b0f5.

feat(discussion): Refactor discussion ban tests for consistency and readability

feat(ban): Refactor ban API functions and add comprehensive tests

feat: soft delete feature (#4)

Implements soft delete functionality for discussion threads, responses, and comments using the is_deleted flag instead of permanently deleting records.
This enables safe deletion and restoration of discussion content while preserving existing data.

Revert "feat: soft delete feature (#4)" (#9)

This reverts commit 8f6699d.

feat: added soft delete functionality (#10)

Implements soft delete functionality for discussion threads, responses, and comments using the is_deleted flag instead of permanently deleting records.
This enables safe deletion and restoration of discussion content while preserving existing data.

feat(ban): Enhance ban and unban APIs to handle User objects directly

refactor(ban): Improve code formatting and readability in ban API

feat(ban): Update get_banned_users to exclude org-level bans with course exceptions
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