From 77336f7d569cb174a88fb4e31036ba4ec291b972 Mon Sep 17 00:00:00 2001 From: Arslan Date: Tue, 5 Nov 2024 18:28:06 +0500 Subject: [PATCH] more refactoring --- lms/djangoapps/instructor_task/views.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/lms/djangoapps/instructor_task/views.py b/lms/djangoapps/instructor_task/views.py index f21f21d4a631..3da3657d465e 100644 --- a/lms/djangoapps/instructor_task/views.py +++ b/lms/djangoapps/instructor_task/views.py @@ -196,15 +196,8 @@ def get_task_completion_info(instructor_task): # lint-amnesty, pylint: disable= # Translators: {action} is a past-tense verb that is localized separately. {succeeded} and {attempted} are counts. # lint-amnesty, pylint: disable=line-too-long msg_format = _("Problem {action} for {succeeded} of {attempted} students") elif course_id is not None: - # this reports on actions for a course as a whole - results = task_output.get('results', {}) - assignments_count = results.get("assignments", 0) - grades_count = results.get("grades", 0) - - msg_format = _("{grades_count} grades and {assignments_count} assignments updated or created").format( - grades_count=grades_count, - assignments_count=assignments_count, - ) + from ol_openedx_canvas_integration.utils import get_task_output_formatted_message + msg_format = get_task_output_formatted_message(task_output) succeeded = True elif email_id is not None: # this reports on actions on bulk emails