# 63 Mail background sending

* moves mail sending to background using celery
This commit is contained in:
2022-01-12 14:27:39 +01:00
parent 9c4bab3800
commit dbf32f3138
5 changed files with 18 additions and 10 deletions

View File

@@ -10,6 +10,8 @@ import uuid
from abc import abstractmethod
from django.contrib import messages
from konova.tasks import celery_send_mail_shared_access_removed
from user.models import User
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpRequest
@@ -413,9 +415,9 @@ class ShareableObjectMixin(models.Model):
)
removed_users = self.users.all().exclude(
id__in=accessing_users
)
).values("id")
for user in removed_users:
user.send_mail_shared_access_removed(self)
celery_send_mail_shared_access_removed.delay(self.identifier, user["id"])
self.share_with_list(users)