From ed3b21d8a13e26bd92f7f1e05aae58f63bd81b5c Mon Sep 17 00:00:00 2001 From: irfanuddinahmad Date: Thu, 2 Jan 2025 19:17:28 +0500 Subject: [PATCH] feat: Disabled MITx from program nudge emails --- .../management/commands/send_program_course_nudge_email.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lms/djangoapps/program_enrollments/management/commands/send_program_course_nudge_email.py b/lms/djangoapps/program_enrollments/management/commands/send_program_course_nudge_email.py index c095b2d161a1..93be5b35e72c 100644 --- a/lms/djangoapps/program_enrollments/management/commands/send_program_course_nudge_email.py +++ b/lms/djangoapps/program_enrollments/management/commands/send_program_course_nudge_email.py @@ -15,6 +15,7 @@ from django.contrib.sites.models import Site from django.core.management import BaseCommand from django.utils import timezone +from opaque_keys.edx.keys import CourseKey from opaque_keys.edx.locator import CourseLocator from common.djangoapps.track import segment @@ -28,6 +29,8 @@ LOGGER = logging.getLogger(__name__) +DISABLED_ORGS = ['MITx'] + class Command(BaseCommand): """ @@ -140,7 +143,9 @@ def get_course_run_to_suggest(self, candidate_programs, completed_course_id, use ) break for course_run in candidate_course['course_runs']: - if self.valid_course_run(course_run) and course_run['key'] != completed_course_id: + course_org = CourseKey.from_string(course_run['key']).org + if self.valid_course_run(course_run) and course_run['key'] != completed_course_id \ + and course_org not in DISABLED_ORGS: return program, course_run, candidate_course return None, None, None