Shows the account activation message in the sidebar
and removes the DISPLAY_ACCOUNT_ACTIVATION_MESSAGE_ON_SIDEBAR flag, since this
feature is now always on.
Marks the top banner as deprecated.
(cherry picked from commit b44114d171)
This commit is contained in:
@@ -112,7 +112,6 @@ class TestActivateAccount(TestCase):
|
||||
def test_activation_without_keys(self, mock_segment_identify):
|
||||
self.assert_no_tracking(mock_segment_identify)
|
||||
|
||||
@override_settings(FEATURES=dict(settings.FEATURES, DISPLAY_ACCOUNT_ACTIVATION_MESSAGE_ON_SIDEBAR=True))
|
||||
def test_account_activation_message(self):
|
||||
"""
|
||||
Verify that account correct activation message is displayed.
|
||||
@@ -149,33 +148,6 @@ class TestActivateAccount(TestCase):
|
||||
response = self.client.get(reverse('dashboard'))
|
||||
self.assertNotContains(response, expected_message, html=True)
|
||||
|
||||
@override_settings(FEATURES=dict(settings.FEATURES, DISPLAY_ACCOUNT_ACTIVATION_MESSAGE_ON_SIDEBAR=False))
|
||||
def test_account_activation_message_disabled(self):
|
||||
"""
|
||||
Verify that old account activation message is displayed when
|
||||
DISPLAY_ACCOUNT_ACTIVATION_MESSAGE_ON_SIDEBAR is disabled.
|
||||
"""
|
||||
# Log in with test user.
|
||||
self.login()
|
||||
expected_message = render_to_string(
|
||||
'registration/activate_account_notice.html',
|
||||
{'email': self.user.email}
|
||||
)
|
||||
|
||||
response = self.client.get(reverse('dashboard'))
|
||||
self.assertContains(response, expected_message, html=True)
|
||||
|
||||
# Now make sure account activation message goes away when user activated the account
|
||||
self.user.is_active = True
|
||||
self.user.save()
|
||||
self.login()
|
||||
expected_message = render_to_string(
|
||||
'registration/activate_account_notice.html',
|
||||
{'email': self.user.email}
|
||||
)
|
||||
response = self.client.get(reverse('dashboard'))
|
||||
self.assertNotContains(response, expected_message, html=True)
|
||||
|
||||
def test_account_activation_notification_on_logistration(self):
|
||||
"""
|
||||
Verify that logistration page displays success/error/info messages
|
||||
|
||||
@@ -602,16 +602,9 @@ def student_dashboard(request):
|
||||
)
|
||||
course_optouts = Optout.objects.filter(user=user).values_list('course_id', flat=True)
|
||||
|
||||
# Display activation message in sidebar
|
||||
sidebar_account_activation_message = ''
|
||||
banner_account_activation_message = ''
|
||||
display_account_activation_message_on_sidebar = configuration_helpers.get_value(
|
||||
'DISPLAY_ACCOUNT_ACTIVATION_MESSAGE_ON_SIDEBAR',
|
||||
settings.FEATURES.get('DISPLAY_ACCOUNT_ACTIVATION_MESSAGE_ON_SIDEBAR', False)
|
||||
)
|
||||
|
||||
# Display activation message in sidebar if DISPLAY_ACCOUNT_ACTIVATION_MESSAGE_ON_SIDEBAR
|
||||
# flag is active. Otherwise display existing message at the top.
|
||||
if display_account_activation_message_on_sidebar and not user.is_active:
|
||||
if not user.is_active:
|
||||
sidebar_account_activation_message = render_to_string(
|
||||
'registration/account_activation_sidebar_notice.html',
|
||||
{
|
||||
@@ -620,11 +613,6 @@ def student_dashboard(request):
|
||||
'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}
|
||||
)
|
||||
|
||||
enterprise_message = get_dashboard_consent_notification(request, user, course_enrollments)
|
||||
|
||||
@@ -794,7 +782,6 @@ def student_dashboard(request):
|
||||
'course_entitlement_available_sessions': course_entitlement_available_sessions,
|
||||
'unfulfilled_entitlement_pseudo_sessions': unfulfilled_entitlement_pseudo_sessions,
|
||||
'course_optouts': course_optouts,
|
||||
'banner_account_activation_message': banner_account_activation_message,
|
||||
'sidebar_account_activation_message': sidebar_account_activation_message,
|
||||
'staff_access': staff_access,
|
||||
'errored_courses': errored_courses,
|
||||
|
||||
@@ -375,9 +375,6 @@ FEATURES = {
|
||||
# See LEARNER-493
|
||||
'ENABLE_ONE_CLICK_PROGRAM_PURCHASE': False,
|
||||
|
||||
# Whether to display account activation notification on dashboard.
|
||||
'DISPLAY_ACCOUNT_ACTIVATION_MESSAGE_ON_SIDEBAR': False,
|
||||
|
||||
# Allow users to change their email address.
|
||||
'ALLOW_EMAIL_ADDRESS_CHANGE': True,
|
||||
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
<%page expression_filter="h"/>
|
||||
<%!
|
||||
from django.utils.translation import ugettext as _
|
||||
from openedx.core.djangolib.markup import HTML, Text
|
||||
%>
|
||||
<div class="wrapper-msg urgency-high">
|
||||
<div class="msg">
|
||||
<div class="msg-content">
|
||||
<h2 class="title">${_("You're almost there!")}</h2>
|
||||
<div class="copy">
|
||||
<p class='activation-message'>${Text(_(
|
||||
"There's just one more step: Before you "
|
||||
"enroll in a course, you need to activate "
|
||||
"your account. We've sent an email message to "
|
||||
"{email_start}{email}{email_end} with "
|
||||
"instructions for activating your account. If "
|
||||
"you don't receive this message, check your "
|
||||
"spam folder."
|
||||
)).format(
|
||||
email_start=HTML("<strong>"),
|
||||
email_end=HTML("</strong>"),
|
||||
email=email,
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user