diff --git a/apps/accounts/notifications.py b/apps/accounts/notifications.py index b650410d1..eb4548d12 100644 --- a/apps/accounts/notifications.py +++ b/apps/accounts/notifications.py @@ -1,7 +1,7 @@ from django.template.loader import render_to_string from django.utils.translation import gettext_lazy as _ -from common.tasks import send_mail_attachment_async, upload_backup_to_obj_storage +from common.tasks import send_mail_attachment, upload_backup_to_obj_storage from notifications.notifications import UserMessage from users.models import User from terminal.models.component.storage import ReplayStorage @@ -27,7 +27,7 @@ class AccountBackupExecutionTaskMsg(object): "to set the encryption password").format(name) def publish(self, attachment_list=None): - send_mail_attachment_async( + send_mail_attachment( self.subject, self.message, [self.user.email], attachment_list ) @@ -70,7 +70,7 @@ class ChangeSecretExecutionTaskMsg(object): "file encryption password to set the encryption password").format(name) def publish(self, attachments=None): - send_mail_attachment_async( + send_mail_attachment( self.subject, self.message, [self.user.email], attachments ) diff --git a/apps/common/tasks.py b/apps/common/tasks.py index d5c0cb609..8af5e17b6 100644 --- a/apps/common/tasks.py +++ b/apps/common/tasks.py @@ -45,8 +45,7 @@ def send_mail_async(*args, **kwargs): logger.error("Sending mail error: {}".format(e)) -@shared_task(verbose_name=_("Send email attachment"), activity_callback=task_activity_callback) -def send_mail_attachment_async(subject, message, recipient_list, attachment_list=None): +def send_mail_attachment(subject, message, recipient_list, attachment_list=None): if attachment_list is None: attachment_list = [] from_email = settings.EMAIL_FROM or settings.EMAIL_HOST_USER @@ -66,7 +65,6 @@ def send_mail_attachment_async(subject, message, recipient_list, attachment_list logger.error("Sending mail attachment error: {}".format(e)) -@shared_task(verbose_name=_('Upload session replay to external storage')) def upload_backup_to_obj_storage(recipient, upload_file): logger.info(f'Start upload file : {upload_file}') remote_path = os.path.join('account_backup', os.path.basename(upload_file))