Skip to content

Commit fadd539

Browse files
feat: Disabled MITx from program nudge emails
1 parent f4c2b46 commit fadd539

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

lms/djangoapps/program_enrollments/management/commands/send_program_course_nudge_email.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from django.contrib.sites.models import Site
1616
from django.core.management import BaseCommand
1717
from django.utils import timezone
18+
from opaque_keys.edx.keys import CourseKey
1819
from opaque_keys.edx.locator import CourseLocator
1920

2021
from common.djangoapps.track import segment
@@ -140,7 +141,9 @@ def get_course_run_to_suggest(self, candidate_programs, completed_course_id, use
140141
)
141142
break
142143
for course_run in candidate_course['course_runs']:
143-
if self.valid_course_run(course_run) and course_run['key'] != completed_course_id:
144+
course_org = CourseKey.from_string(course_run['key']).org
145+
if self.valid_course_run(course_run) and course_run['key'] != completed_course_id \
146+
and course_org not in settings.DISABLED_ORGS_FOR_PROGRAM_NUDGE:
144147
return program, course_run, candidate_course
145148
return None, None, None
146149

lms/envs/common.py

+8
Original file line numberDiff line numberDiff line change
@@ -5376,6 +5376,14 @@ def _make_locale_paths(settings): # pylint: disable=missing-function-docstring
53765376
NOTIFICATION_TYPE_ICONS = {}
53775377
DEFAULT_NOTIFICATION_ICON_URL = ""
53785378

5379+
############## NUDGE EMAILS ###############
5380+
# .. setting_name: DISABLED_ORGS_FOR_PROGRAM_NUDGE
5381+
# .. setting_default: []
5382+
# .. setting_description: List of organization codes that should be disabled
5383+
# .. for program nudge emails.
5384+
# .. eg ['BTDx', 'MYTx']
5385+
DISABLED_ORGS_FOR_PROGRAM_NUDGE = []
5386+
53795387
############################ AI_TRANSLATIONS ##################################
53805388
AI_TRANSLATIONS_API_URL = 'http://localhost:18760/api/v1'
53815389

0 commit comments

Comments
 (0)