diff --git a/cms/envs/common.py b/cms/envs/common.py index 2777132278..3eefa42bf6 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -94,6 +94,7 @@ from lms.envs.common import ( HELP_TOKENS_BOOKS, SUPPORT_SITE_LINK, + ACTIVATION_EMAIL_SUPPORT_LINK, CONTACT_EMAIL, diff --git a/common/djangoapps/student/tests/test_activate_account.py b/common/djangoapps/student/tests/test_activate_account.py index 62e89a6cbe..29876fe437 100644 --- a/common/djangoapps/student/tests/test_activate_account.py +++ b/common/djangoapps/student/tests/test_activate_account.py @@ -11,6 +11,7 @@ from uuid import uuid4 from edxmako.shortcuts import render_to_string from student.models import Registration from student.tests.factories import UserFactory +from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers @unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms') @@ -31,6 +32,11 @@ class TestActivateAccount(TestCase): self.registration.register(self.user) self.registration.save() + self.platform_name = configuration_helpers.get_value('PLATFORM_NAME', settings.PLATFORM_NAME) + self.activation_email_support_link = configuration_helpers.get_value( + 'ACTIVATION_EMAIL_SUPPORT_LINK', settings.SUPPORT_SITE_LINK # Intentional default. + ) + def login(self): """ Login with test user. @@ -118,7 +124,11 @@ class TestActivateAccount(TestCase): self.login() expected_message = render_to_string( 'registration/account_activation_sidebar_notice.html', - {'email': self.user.email} + { + 'email': self.user.email, + 'platform_name': self.platform_name, + 'activation_email_support_link': self.activation_email_support_link + } ) response = self.client.get(reverse('dashboard')) @@ -130,7 +140,11 @@ class TestActivateAccount(TestCase): self.login() expected_message = render_to_string( 'registration/account_activation_sidebar_notice.html', - {'email': self.user.email} + { + 'email': self.user.email, + 'platform_name': self.platform_name, + 'activation_email_support_link': self.activation_email_support_link + } ) response = self.client.get(reverse('dashboard')) self.assertNotContains(response, expected_message, html=True) diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py index ebbd3ae0eb..d658eeb374 100644 --- a/common/djangoapps/student/views.py +++ b/common/djangoapps/student/views.py @@ -657,6 +657,9 @@ def dashboard(request): 'DISPLAY_COURSE_MODES_ON_DASHBOARD', settings.FEATURES.get('DISPLAY_COURSE_MODES_ON_DASHBOARD', True) ) + activation_email_support_link = configuration_helpers.get_value( + 'ACTIVATION_EMAIL_SUPPORT_LINK', settings.SUPPORT_SITE_LINK + ) # Let's filter out any courses in an "org" that has been declared to be # in a configuration @@ -712,12 +715,16 @@ def dashboard(request): if display_account_activation_message_on_sidebar and not user.is_active: sidebar_account_activation_message = render_to_string( 'registration/account_activation_sidebar_notice.html', - {'email': user.email} + { + 'email': user.email, + 'platform_name': platform_name, + 'activation_email_support_link': activation_email_support_link + } ) elif not user.is_active: banner_account_activation_message = render_to_string( 'registration/activate_account_notice.html', - {'email': user.email, 'platform_name': platform_name} + {'email': user.email} ) enterprise_message = get_dashboard_consent_notification(request, user, course_enrollments) @@ -727,11 +734,11 @@ def dashboard(request): message for message in messages.get_messages(request) if 'account-activation' in message.tags ] - # Global staff can see what courses errored on their dashboard + # Global staff can see what courses encountered an error on their dashboard staff_access = False errored_courses = {} if has_access(user, 'staff', 'global'): - # Show any courses that errored on load + # Show any courses that encountered an error on load staff_access = True errored_courses = modulestore().get_errored_courses() diff --git a/lms/envs/aws.py b/lms/envs/aws.py index 00e42b9d16..8505b58a1d 100644 --- a/lms/envs/aws.py +++ b/lms/envs/aws.py @@ -310,6 +310,9 @@ ENABLE_COMPREHENSIVE_THEMING = ENV_TOKENS.get('ENABLE_COMPREHENSIVE_THEMING', EN MKTG_URL_LINK_MAP.update(ENV_TOKENS.get('MKTG_URL_LINK_MAP', {})) SUPPORT_SITE_LINK = ENV_TOKENS.get('SUPPORT_SITE_LINK', SUPPORT_SITE_LINK) +ACTIVATION_EMAIL_SUPPORT_LINK = ENV_TOKENS.get( + 'ACTIVATION_EMAIL_SUPPORT_LINK', SUPPORT_SITE_LINK # Intentional default. +) # Mobile store URL overrides MOBILE_STORE_URLS = ENV_TOKENS.get('MOBILE_STORE_URLS', MOBILE_STORE_URLS) diff --git a/lms/envs/bok_choy.env.json b/lms/envs/bok_choy.env.json index 2abdf5dc68..4bec01ab1f 100644 --- a/lms/envs/bok_choy.env.json +++ b/lms/envs/bok_choy.env.json @@ -137,6 +137,7 @@ "SITE_NAME": "localhost:8003", "STATIC_URL_BASE": "/static/", "SUPPORT_SITE_LINK": "https://support.example.com", + "ACTIVATION_EMAIL_SUPPORT_LINK": "https://support.example.com/activation-email-help.html", "SYSLOG_SERVER": "", "TECH_SUPPORT_EMAIL": "technical@example.com", "THIRD_PARTY_AUTH_BACKENDS": [ diff --git a/lms/envs/common.py b/lms/envs/common.py index 9732fbc353..5b06aade2d 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -2268,6 +2268,7 @@ MKTG_URL_LINK_MAP = { STATIC_TEMPLATE_VIEW_DEFAULT_FILE_EXTENSION = 'html' SUPPORT_SITE_LINK = '' +ACTIVATION_EMAIL_SUPPORT_LINK = '' ############################# SOCIAL MEDIA SHARING ############################# # Social Media Sharing on Student Dashboard diff --git a/lms/envs/test.py b/lms/envs/test.py index 5457a39841..0bb120d69b 100644 --- a/lms/envs/test.py +++ b/lms/envs/test.py @@ -361,6 +361,7 @@ MKTG_URL_LINK_MAP = { } SUPPORT_SITE_LINK = 'https://support.example.com' +ACTIVATION_EMAIL_SUPPORT_LINK = 'https://support.example.com/activation-email-help.html' ############################ STATIC FILES ############################# DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage' diff --git a/lms/templates/registration/account_activation_sidebar_notice.html b/lms/templates/registration/account_activation_sidebar_notice.html index d0d2f5f799..556f6e6d7b 100644 --- a/lms/templates/registration/account_activation_sidebar_notice.html +++ b/lms/templates/registration/account_activation_sidebar_notice.html @@ -1,7 +1,6 @@ <%page expression_filter="h"/> <%! from django.utils.translation import ugettext as _ -from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers from openedx.core.djangolib.markup import HTML, Text %>