From 9fd5157577d52b636b906567622cb4680435da27 Mon Sep 17 00:00:00 2001 From: Mubbshar Anwar <78487564+mubbsharanwar@users.noreply.github.com> Date: Tue, 20 Feb 2024 11:48:50 +0500 Subject: [PATCH] fix: update activation email (#34136) update account activation email message copy in body VAN-1800 --- common/djangoapps/student/views/management.py | 3 +++ openedx/core/djangoapps/user_authn/tests/test_tasks.py | 1 + 2 files changed, 4 insertions(+) diff --git a/common/djangoapps/student/views/management.py b/common/djangoapps/student/views/management.py index d3e1c54180d3..2b0c21bfbf99 100644 --- a/common/djangoapps/student/views/management.py +++ b/common/djangoapps/student/views/management.py @@ -177,7 +177,9 @@ def compose_activation_email(user, user_registration=None, route_enabled=False, Construct all the required params for the activation email through celery task """ + registration_flow = True if user_registration is None: + registration_flow = False user_registration = Registration.objects.get(user=user) message_context = generate_activation_email_context(user, user_registration) @@ -187,6 +189,7 @@ def compose_activation_email(user, user_registration=None, route_enabled=False, 'routed_user': user.username, 'routed_user_email': user.email, 'routed_profile_name': profile_name, + 'registration_flow': registration_flow, }) if route_enabled: diff --git a/openedx/core/djangoapps/user_authn/tests/test_tasks.py b/openedx/core/djangoapps/user_authn/tests/test_tasks.py index 61d06e1afa8e..7598448412ab 100644 --- a/openedx/core/djangoapps/user_authn/tests/test_tasks.py +++ b/openedx/core/djangoapps/user_authn/tests/test_tasks.py @@ -42,6 +42,7 @@ def test_ComposeEmail(self): assert self.msg.context['routed_user'] == self.student.username assert self.msg.context['routed_user_email'] == self.student.email assert self.msg.context['routed_profile_name'] == '' + assert self.msg.context['registration_flow'] is True @mock.patch('time.sleep', mock.Mock(return_value=None)) @mock.patch('openedx.core.djangoapps.user_authn.tasks.log')