feat!: change learner home to use SEND_ACTIVATIION_EMAIl_URL (#36807)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user