diff --git a/lms/djangoapps/instructor/views/api.py b/lms/djangoapps/instructor/views/api.py index 3f944bc63e9..2c0cc56456e 100644 --- a/lms/djangoapps/instructor/views/api.py +++ b/lms/djangoapps/instructor/views/api.py @@ -2424,6 +2424,7 @@ def _list_instructor_tasks(request, course_id, serialize_data=None): Internal function with common code for both DRF and and tradition views. """ + # This method is also used by other APIs with the GET method. # The query_params attribute is utilized for GET requests, # where parameters are passed as query strings. @@ -2457,10 +2458,10 @@ def _list_instructor_tasks(request, course_id, serialize_data=None): # Specifying for single problem's history tasks = task_api.get_instructor_task_history(course_id, module_state_key) elif include_canvas: - tasks = task_api.get_running_instructor_canvas_tasks( - course_id, - user=request.user - ) + from ol_openedx_canvas_integration.constants import CANVAS_TASK_TYPES # pylint: disable=import-error + from ol_openedx_canvas_integration.task_helpers import _get_filtered_instructor_tasks + + tasks = _get_filtered_instructor_tasks(course_id, request.user, CANVAS_TASK_TYPES) else: # If no problem or student, just get currently running tasks tasks = task_api.get_running_instructor_tasks(course_id) diff --git a/lms/djangoapps/instructor_task/api.py b/lms/djangoapps/instructor_task/api.py index 4111f63a5ed..62095c3ae3a 100644 --- a/lms/djangoapps/instructor_task/api.py +++ b/lms/djangoapps/instructor_task/api.py @@ -75,17 +75,6 @@ def get_running_instructor_tasks(course_id): return instructor_tasks.order_by('-id') -def get_running_instructor_canvas_tasks(course_id, user): - """ - Returns a query of InstructorTask objects of running tasks for a given course - including canvas-specific tasks. - """ - # Inline import because we will install the plugin separately - from ol_openedx_canvas_integration.constants import CANVAS_TASK_TYPES # pylint: disable=import-error - from ol_openedx_canvas_integration.task_helpers import _get_filtered_instructor_tasks - return _get_filtered_instructor_tasks(course_id, user, CANVAS_TASK_TYPES) - - def get_instructor_task_history(course_id, usage_key=None, student=None, task_type=None): """ Returns a query of InstructorTask objects of historical tasks for a given course,