From 47fbf58456bd0e4516737bfc2e1b1c3e2b7a0039 Mon Sep 17 00:00:00 2001 From: Maxwell Frank <92897870+MaxFrank13@users.noreply.github.com> Date: Fri, 20 Jun 2025 10:43:30 -0400 Subject: [PATCH] feat!: change learner home to use SEND_ACTIVATIION_EMAIl_URL (#36807) --- lms/djangoapps/learner_home/test_views.py | 12 ++++++------ lms/djangoapps/learner_home/views.py | 7 +++---- lms/envs/common.py | 1 + lms/envs/mock.yml | 2 +- lms/envs/test.py | 1 + 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/lms/djangoapps/learner_home/test_views.py b/lms/djangoapps/learner_home/test_views.py index 6f0babe414..5b09893971 100644 --- a/lms/djangoapps/learner_home/test_views.py +++ b/lms/djangoapps/learner_home/test_views.py @@ -94,7 +94,7 @@ class TestGetUserAccountConfirmationInfo(SharedModuleStoreTestCase): """Tests for get_user_account_confirmation_info""" MOCK_SETTINGS = { - "ACTIVATION_EMAIL_SUPPORT_LINK": "activation.example.com", + "SEND_ACTIVATION_EMAIL_URL": "activation.example.com", "SUPPORT_SITE_LINK": "support.example.com", } @@ -120,24 +120,24 @@ class TestGetUserAccountConfirmationInfo(SharedModuleStoreTestCase): assert user_account_confirmation_info["isNeeded"] == (not user_is_active) @patch( - "django.conf.settings.ACTIVATION_EMAIL_SUPPORT_LINK", - MOCK_SETTINGS["ACTIVATION_EMAIL_SUPPORT_LINK"], + "django.conf.settings.SEND_ACTIVATION_EMAIL_URL", + MOCK_SETTINGS["SEND_ACTIVATION_EMAIL_URL"], ) def test_email_url_support_link(self): - # Given an ACTIVATION_EMAIL_SUPPORT_LINK is supplied + # Given an SEND_ACTIVATION_EMAIL_URL is supplied # When I get user account confirmation info user_account_confirmation_info = get_user_account_confirmation_info(self.user) # Then that link should be returned as the sendEmailUrl self.assertEqual( user_account_confirmation_info["sendEmailUrl"], - self.MOCK_SETTINGS["ACTIVATION_EMAIL_SUPPORT_LINK"], + self.MOCK_SETTINGS["SEND_ACTIVATION_EMAIL_URL"], ) @patch("lms.djangoapps.learner_home.views.configuration_helpers") @patch("django.conf.settings.SUPPORT_SITE_LINK", MOCK_SETTINGS["SUPPORT_SITE_LINK"]) def test_email_url_support_fallback_link(self, mock_config_helpers): - # Given an ACTIVATION_EMAIL_SUPPORT_LINK is NOT supplied + # Given an SEND_ACTIVATION_EMAIL_URL is NOT supplied mock_config_helpers.get_value.return_value = None # When I get user account confirmation info diff --git a/lms/djangoapps/learner_home/views.py b/lms/djangoapps/learner_home/views.py index 1fa115be58..b97f9a20f4 100644 --- a/lms/djangoapps/learner_home/views.py +++ b/lms/djangoapps/learner_home/views.py @@ -81,17 +81,16 @@ def get_platform_settings(): @function_trace("get_user_account_confirmation_info") def get_user_account_confirmation_info(user): """Determine if a user needs to verify their account and related URL info""" - - activation_email_support_link = ( + send_activation_email_url = ( configuration_helpers.get_value( - "ACTIVATION_EMAIL_SUPPORT_LINK", settings.ACTIVATION_EMAIL_SUPPORT_LINK + "SEND_ACTIVATION_EMAIL_URL", settings.SEND_ACTIVATION_EMAIL_URL ) or settings.SUPPORT_SITE_LINK ) email_confirmation = { "isNeeded": not user.is_active, - "sendEmailUrl": activation_email_support_link, + "sendEmailUrl": send_activation_email_url, } return email_confirmation diff --git a/lms/envs/common.py b/lms/envs/common.py index 95c6d22328..41ea8ffe72 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -3493,6 +3493,7 @@ SUPPORT_SITE_LINK = '' ID_VERIFICATION_SUPPORT_LINK = '' PASSWORD_RESET_SUPPORT_LINK = '' ACTIVATION_EMAIL_SUPPORT_LINK = '' +SEND_ACTIVATION_EMAIL_URL = '' LOGIN_ISSUE_SUPPORT_LINK = '' # .. setting_name: SECURITY_PAGE_URL diff --git a/lms/envs/mock.yml b/lms/envs/mock.yml index cdcbcf49e5..386388a887 100644 --- a/lms/envs/mock.yml +++ b/lms/envs/mock.yml @@ -4,7 +4,6 @@ # WARNING: Do not use this in production -- it contains randomized and # nonsensical values. - ACCOUNT_MICROFRONTEND_URL: null ACE_CHANNEL_BRAZE_API_KEY: '[encrypted]' ACE_CHANNEL_BRAZE_APP_ID: hello @@ -1069,6 +1068,7 @@ SEARCH_COURSEWARE_CONTENT_LOG_PARAMS: true SECRET_KEY: test_secret_key SECURITY_PAGE_URL: hello SEGMENT_KEY: null +SEND_ACTIVATION_EMAIL_URL: 'https://courses.example.edx.org/api/send_account_activation_email' SEND_CERTIFICATE_CREATED_SIGNAL: true SEND_CERTIFICATE_REVOKED_SIGNAL: true SERVER_EMAIL: devops@example.com diff --git a/lms/envs/test.py b/lms/envs/test.py index 628195b902..1be492f989 100644 --- a/lms/envs/test.py +++ b/lms/envs/test.py @@ -287,6 +287,7 @@ MKTG_URL_LINK_MAP = { SUPPORT_SITE_LINK = 'https://example.support.edx.org' PASSWORD_RESET_SUPPORT_LINK = 'https://support.example.com/password-reset-help.html' ACTIVATION_EMAIL_SUPPORT_LINK = 'https://support.example.com/activation-email-help.html' +SEND_ACTIVATION_EMAIL_URL = 'https://courses.example.edx.org/api/send_account_activation_email' LOGIN_ISSUE_SUPPORT_LINK = 'https://support.example.com/login-issue-help.html' ENTERPRISE_MARKETING_FOOTER_QUERY_PARAMS = OrderedDict([ ("utm_campaign", "edX.org Referral"),