Skip to content

Commit bae8e17

Browse files
feat: Disabled MITx from program nudge emails
1 parent 645e898 commit bae8e17

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
@@ -5388,6 +5388,14 @@ def _make_locale_paths(settings): # pylint: disable=missing-function-docstring
53885388
NOTIFICATION_TYPE_ICONS = {}
53895389
DEFAULT_NOTIFICATION_ICON_URL = ""
53905390

5391+
############## NUDGE EMAILS ###############
5392+
# .. setting_name: DISABLED_ORGS_FOR_PROGRAM_NUDGE
5393+
# .. setting_default: []
5394+
# .. setting_description: List of organization codes that should be disabled
5395+
# .. for program nudge emails.
5396+
# .. eg ['BTDx', 'MYTx']
5397+
DISABLED_ORGS_FOR_PROGRAM_NUDGE = []
5398+
53915399
############################ AI_TRANSLATIONS ##################################
53925400
AI_TRANSLATIONS_API_URL = 'http://localhost:18760/api/v1'
53935401

0 commit comments

Comments
 (0)