Skip to content

Commit f055bb9

Browse files
feanilclaude
andcommitted
feat: remove ENABLE_MKTG_SITE from student email view
Email change confirmation contact link now always comes from marketing_link('CONTACT') via MKTG_URLS. Remove the fallback that constructed a local URL when the flag was False. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent ad13690 commit f055bb9

3 files changed

Lines changed: 6 additions & 30 deletions

File tree

common/djangoapps/student/tests/test_email.py

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -530,15 +530,7 @@ def assertChangeEmailSent(self, test_body_type):
530530
# Must have two items in outbox: one for old email, another for new email
531531
assert len(mail.outbox) == 2
532532

533-
use_https = self.request.is_secure()
534-
if settings.FEATURES['ENABLE_MKTG_SITE']:
535-
contact_link = marketing_link('CONTACT')
536-
else:
537-
contact_link = '{protocol}://{site}{link}'.format(
538-
protocol='https' if use_https else 'http',
539-
site=settings.SITE_NAME,
540-
link=reverse('contact'),
541-
)
533+
contact_link = marketing_link('CONTACT')
542534

543535
# Verifying contents
544536
for msg in mail.outbox:
@@ -589,17 +581,10 @@ def test_new_email_fails(self, ace_mail):
589581
@skip_unless_lms
590582
@override_settings(MKTG_URLS={'ROOT': 'https://dummy-root', 'CONTACT': '/help/contact-us'})
591583
@patch('common.djangoapps.student.signals.signals.USER_EMAIL_CHANGED.send')
592-
@ddt.data(
593-
('plain_text', False),
594-
('plain_text', True),
595-
('html', False),
596-
('html', True)
597-
)
598-
@ddt.unpack
599-
def test_successful_email_change(self, test_body_type, test_marketing_enabled, mock_email_change_signal):
600-
with patch.dict(settings.FEATURES, {'ENABLE_MKTG_SITE': test_marketing_enabled}):
601-
self.assertChangeEmailSent(test_body_type)
602-
assert mock_email_change_signal.called
584+
@ddt.data('plain_text', 'html')
585+
def test_successful_email_change(self, test_body_type, mock_email_change_signal):
586+
self.assertChangeEmailSent(test_body_type)
587+
assert mock_email_change_signal.called
603588

604589
meta = json.loads(UserProfile.objects.get(user=self.user).meta)
605590
assert 'old_emails' in meta

common/djangoapps/student/tests/test_views.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ class StudentDashboardTests(SharedModuleStoreTestCase, MilestonesTestCaseMixin,
194194
MOCK_SETTINGS = {
195195
'FEATURES': {
196196
'DISABLE_START_DATES': False,
197-
'ENABLE_MKTG_SITE': True,
198197
'DISABLE_SET_JWT_COOKIES_FOR_TESTS': True,
199198
},
200199
'SOCIAL_SHARING_SETTINGS': {

common/djangoapps/student/views/management.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -924,15 +924,7 @@ def confirm_email_change(request, key):
924924
transaction.set_rollback(True)
925925
return response
926926

927-
use_https = request.is_secure()
928-
if settings.FEATURES['ENABLE_MKTG_SITE']:
929-
contact_link = marketing_link('CONTACT')
930-
else:
931-
contact_link = '{protocol}://{site}{link}'.format(
932-
protocol='https' if use_https else 'http',
933-
site=configuration_helpers.get_value('SITE_NAME', settings.SITE_NAME),
934-
link=reverse('contact'),
935-
)
927+
contact_link = marketing_link('CONTACT')
936928

937929
site = Site.objects.get_current()
938930
message_context = get_base_template_context(site)

0 commit comments

Comments
 (0)