Skip to content

Commit 40bc3e1

Browse files
committed
feat: added soft delete functionality
1 parent ff69a78 commit 40bc3e1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

openedx/core/djangoapps/django_comment_common/comment_client/comment.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from .thread import Thread
1010
from .utils import CommentClientRequestError, get_course_key
1111
from forum import api as forum_api
12-
from forum.api.comments import restore_comment as forum_restore_comment, soft_delete_comment
12+
from forum.api.comments import restore_comment, soft_delete_comment
1313
from forum.backends.mongodb.comments import Comment as ForumComment
1414
from forum.utils import ForumV2RequestError
1515
from rest_framework.serializers import ValidationError
@@ -205,7 +205,7 @@ def restore_user_comments(cls, user_id, course_ids):
205205
course_id = comment.get("course_id")
206206
if comment_id:
207207
try:
208-
forum_restore_comment(str(comment_id), str(course_id))
208+
restore_comment(str(comment_id), str(course_id))
209209
comments_restored += 1
210210
except (ForumV2RequestError, ValidationError) as e:
211211
log.error("Error restoring comment %s: %s", comment_id, e)

openedx/core/djangoapps/django_comment_common/comment_client/thread.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from django.core.exceptions import ObjectDoesNotExist
1111
from forum import api as forum_api
12-
from forum.api.threads import prepare_thread_api_response, restore_thread as forum_restore_thread, soft_delete_thread
12+
from forum.api.threads import prepare_thread_api_response, restore_thread, soft_delete_thread
1313
from forum.backend import get_backend
1414
from forum.backends.mongodb.threads import CommentThread as ForumThread
1515
from forum.utils import ForumV2RequestError
@@ -371,7 +371,7 @@ def restore_user_threads(cls, user_id, course_ids):
371371
course_id = thread.get("course_id")
372372
if thread_id:
373373
try:
374-
forum_restore_thread(str(thread_id), str(course_id))
374+
restore_thread(str(thread_id), str(course_id))
375375
threads_restored += 1
376376
except (ForumV2RequestError, ValidationError) as e:
377377
log.error("Error restoring thread %s: %s", thread_id, e)

0 commit comments

Comments
 (0)