Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Disabled MITx from program nudge emails #36071

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -140,7 +141,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 settings.DISABLED_ORGS_FOR_PROGRAM_NUDGE:
return program, course_run, candidate_course
return None, None, None

Expand Down
8 changes: 8 additions & 0 deletions lms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -5376,6 +5376,14 @@ def _make_locale_paths(settings): # pylint: disable=missing-function-docstring
NOTIFICATION_TYPE_ICONS = {}
DEFAULT_NOTIFICATION_ICON_URL = ""

############## NUDGE EMAILS ###############
# .. setting_name: DISABLED_ORGS_FOR_PROGRAM_NUDGE
# .. setting_default: []
# .. setting_description: List of organization codes that should be disabled
# .. for program nudge emails.
# .. eg ['BTDx', 'MYTx']
DISABLED_ORGS_FOR_PROGRAM_NUDGE = []
irfanuddinahmad marked this conversation as resolved.
Show resolved Hide resolved

############################ AI_TRANSLATIONS ##################################
AI_TRANSLATIONS_API_URL = 'http://localhost:18760/api/v1'

Expand Down
Loading