@@ -715,7 +715,7 @@ def delete_thread(request, course_id, thread_id):
715
715
course_key = CourseKey .from_string (course_id )
716
716
course = get_course_with_access (request .user , 'load' , course_key )
717
717
thread = cc .Thread .find (thread_id )
718
- thread .delete ()
718
+ thread .delete (course_id = course_id )
719
719
thread_deleted .send (sender = None , user = request .user , post = thread )
720
720
721
721
track_thread_deleted_event (request , course , thread )
@@ -781,7 +781,7 @@ def openclose_thread(request, course_id, thread_id):
781
781
thread = cc .Thread .find (thread_id )
782
782
close_thread = request .POST .get ('closed' , 'false' ).lower () == 'true'
783
783
thread .closed = close_thread
784
- thread .save ()
784
+ thread .save (params = { "course_id" : course_id } )
785
785
786
786
track_thread_lock_unlock_event (request , course , thread , None , close_thread )
787
787
return JsonResponse ({
@@ -976,7 +976,7 @@ def pin_thread(request, course_id, thread_id):
976
976
course_key = CourseKey .from_string (course_id )
977
977
user = cc .User .from_django_user (request .user )
978
978
thread = cc .Thread .find (thread_id )
979
- thread .pin (user , thread_id )
979
+ thread .pin (user , thread_id , course_id )
980
980
981
981
return JsonResponse (prepare_content (thread .to_dict (), course_key ))
982
982
@@ -992,7 +992,7 @@ def un_pin_thread(request, course_id, thread_id):
992
992
course_key = CourseKey .from_string (course_id )
993
993
user = cc .User .from_django_user (request .user )
994
994
thread = cc .Thread .find (thread_id )
995
- thread .un_pin (user , thread_id )
995
+ thread .un_pin (user , thread_id , course_id )
996
996
997
997
return JsonResponse (prepare_content (thread .to_dict (), course_key ))
998
998
@@ -1021,7 +1021,7 @@ def follow_commentable(request, course_id, commentable_id): # lint-amnesty, pyl
1021
1021
"""
1022
1022
user = cc .User .from_django_user (request .user )
1023
1023
commentable = cc .Commentable .find (commentable_id )
1024
- user .follow (commentable )
1024
+ user .follow (commentable , course_id = course_id )
1025
1025
return JsonResponse ({})
1026
1026
1027
1027
@@ -1053,7 +1053,7 @@ def unfollow_commentable(request, course_id, commentable_id): # lint-amnesty, p
1053
1053
"""
1054
1054
user = cc .User .from_django_user (request .user )
1055
1055
commentable = cc .Commentable .find (commentable_id )
1056
- user .unfollow (commentable )
1056
+ user .unfollow (commentable , course_id = course_id )
1057
1057
return JsonResponse ({})
1058
1058
1059
1059
0 commit comments