Skip to content
Snippets Groups Projects
Unverified Commit e9175c23 authored by Alexander J Sheehan's avatar Alexander J Sheehan Committed by GitHub
Browse files

Merge pull request #26444 from edx/alex-sheehan-edx/use-the-right-integrated-channels-task

replace bulk transmission task to intended single learner task
parents 3e6c201c aaa37507
No related branches found
Tags release-2021-02-09-14.12
No related merge requests found
......@@ -107,8 +107,9 @@ class SubsectionGradeFactory(object):
self._update_saved_subsection_grade(subsection.location, grade_model)
if settings.FEATURES.get('ENABLE_COURSE_ASSESSMENT_GRADE_CHANGE_SIGNAL'):
COURSE_ASSESSMENT_GRADE_CHANGED.send_robust(
COURSE_ASSESSMENT_GRADE_CHANGED.send(
sender=self,
course_id=self.course_data.course_key,
user=self.student,
subsection_id=calculated_grade.location,
subsection_grade=calculated_grade.graded_total.earned
......
......@@ -57,7 +57,7 @@ class TestSubsectionGradeFactory(ProblemSubmissionTestMixin, GradeTestBase):
"""
with mock_get_score(1, 2):
with patch(
'openedx.core.djangoapps.signals.signals.COURSE_ASSESSMENT_GRADE_CHANGED.send_robust'
'openedx.core.djangoapps.signals.signals.COURSE_ASSESSMENT_GRADE_CHANGED.send'
) as mock_update_grades_signal:
grade = self.subsection_grade_factory.update(self.sequence)
self.assert_grade(grade, 1, 2)
......
......@@ -11,7 +11,10 @@ from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imp
from django.db.models.signals import post_save, pre_save
from django.dispatch import receiver
from enterprise.models import EnterpriseCourseEnrollment, EnterpriseCustomer, EnterpriseCustomerUser
from integrated_channels.integrated_channel.tasks import transmit_single_learner_data, transmit_subsection_learner_data
from integrated_channels.integrated_channel.tasks import (
transmit_single_learner_data,
transmit_single_subsection_learner_data
)
from slumber.exceptions import HttpClientError
from lms.djangoapps.email_marketing.tasks import update_user
......@@ -99,7 +102,7 @@ def handle_enterprise_learner_subsection(sender, user, course_id, subsection_id,
'grade': str(subsection_grade),
}
transmit_subsection_learner_data.apply_async(kwargs=kwargs)
transmit_single_subsection_learner_data.apply_async(kwargs=kwargs)
@receiver(UNENROLL_DONE)
......
......@@ -213,7 +213,7 @@ class EnterpriseSupportSignals(SharedModuleStoreTestCase):
Test to assert transmit_subsection_learner_data is called when COURSE_ASSESSMENT_GRADE_CHANGED signal is fired.
"""
with patch(
'integrated_channels.integrated_channel.tasks.transmit_subsection_learner_data.apply_async',
'integrated_channels.integrated_channel.tasks.transmit_single_subsection_learner_data.apply_async',
return_value=None
) as mock_task_apply:
course_key = CourseKey.from_string(self.course_id)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment