From 6f9fc234fcd94ca09da7c5c91376e8fb28ae9862 Mon Sep 17 00:00:00 2001 From: Dmytro <98233552+DmytroAlipov@users.noreply.github.com> Date: Thu, 24 Aug 2023 15:10:12 +0300 Subject: [PATCH] fix: TypeError during student.send_activation_email task (#32743) --- openedx/core/djangoapps/user_authn/tasks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openedx/core/djangoapps/user_authn/tasks.py b/openedx/core/djangoapps/user_authn/tasks.py index 27ddfe466e3b..9c2c4ef1098c 100644 --- a/openedx/core/djangoapps/user_authn/tasks.py +++ b/openedx/core/djangoapps/user_authn/tasks.py @@ -45,7 +45,7 @@ def check_pwned_password_and_send_track_event(user_id, password, internal_user=F @shared_task(bind=True, default_retry_delay=30, max_retries=2) @set_code_owner_attribute -def send_activation_email(self, msg_string, from_address=None): +def send_activation_email(self, msg_string, from_address=None, site_id=None): """ Sending an activation email to the user. """ @@ -62,7 +62,7 @@ def send_activation_email(self, msg_string, from_address=None): dest_addr = msg.recipient.email_address - site = Site.objects.get_current() + site = Site.objects.get(id=site_id) if site_id else Site.objects.get_current() user = User.objects.get(id=msg.recipient.lms_user_id) try: