# 63 Mail background sending
* moves mail sending to background using celery
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user