From 40dba56cff3f1d43b67922f96ab787fa1cae8bae Mon Sep 17 00:00:00 2001 From: Zainab Amir Date: Thu, 9 Sep 2021 14:13:35 +0500 Subject: [PATCH] fix: auto register send_activation_email task (#28694) --- openedx/core/djangoapps/user_authn/tasks.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/openedx/core/djangoapps/user_authn/tasks.py b/openedx/core/djangoapps/user_authn/tasks.py index 2392d3b3cb..5a4d2d36b9 100644 --- a/openedx/core/djangoapps/user_authn/tasks.py +++ b/openedx/core/djangoapps/user_authn/tasks.py @@ -20,8 +20,9 @@ from openedx.core.lib.celery.task_utils import emulate_http_request log = logging.getLogger('edx.celery.task') +@shared_task(bind=True) @set_code_owner_attribute -def _send_activation_email(self, msg_string, from_address=None): +def send_activation_email(self, msg_string, from_address=None): """ Sending an activation email to the user. """ @@ -66,15 +67,3 @@ def _send_activation_email(self, msg_string, from_address=None): dest_addr, ) raise Exception # lint-amnesty, pylint: disable=raise-missing-from - - -_OLD_TASK_NAME = 'common.djangoapps.student.tasks.send_activation_email' -_NEW_TASK_NAME = 'openedx.core.djangoapps.user_authn.tasks.send_activation_email' - - -# Register task under both its old and new names, -# but expose only the new-named task for invocation. -# -> Next step: Once we deploy and stop using the old task name, -# stop registering the task under the old name. -shared_task(bind=True, name=_OLD_TASK_NAME)(_send_activation_email) -send_activation_email = shared_task(bind=True, name=_NEW_TASK_NAME)(_send_activation_email)