temp: added logs to debug issue in bulk delete count (#37073)
This commit is contained in:
committed by
GitHub
parent
4d76c5ded0
commit
7af4b644d0
@@ -1575,14 +1575,18 @@ class BulkDeleteUserPosts(DeveloperErrorViewMixin, APIView):
|
|||||||
course_ids = [course_id]
|
course_ids = [course_id]
|
||||||
if course_or_org == "org":
|
if course_or_org == "org":
|
||||||
org_id = CourseKey.from_string(course_id).org
|
org_id = CourseKey.from_string(course_id).org
|
||||||
|
enrollments = CourseEnrollment.objects.filter(user=request.user).values_list('course_id', flat=True)
|
||||||
course_ids = [
|
course_ids = [
|
||||||
str(c_id)
|
str(c_id)
|
||||||
for c_id in CourseEnrollment.objects.filter(user=request.user).values_list('course_id', flat=True)
|
for c_id in enrollments
|
||||||
if c_id.org == org_id
|
if c_id.org == org_id
|
||||||
]
|
]
|
||||||
|
log.info(f"<<Bulk Delete>> {username} enrolled in {enrollments}")
|
||||||
|
log.info(f"<<Bulk Delete>> Posts for {username} in {course_ids} - for {course_or_org} {course_id}")
|
||||||
|
|
||||||
comment_count = Comment.get_user_comment_count(user.id, course_ids)
|
comment_count = Comment.get_user_comment_count(user.id, course_ids)
|
||||||
thread_count = Thread.get_user_threads_count(user.id, course_ids)
|
thread_count = Thread.get_user_threads_count(user.id, course_ids)
|
||||||
|
log.info(f"<<Bulk Delete>> {username} in {course_ids} - Count thread {thread_count}, comment {comment_count}")
|
||||||
|
|
||||||
if execute_task:
|
if execute_task:
|
||||||
event_data = {
|
event_data = {
|
||||||
|
|||||||
Reference in New Issue
Block a user