# 63 Mail data checked

* adds mail sending if shared data is checked
* adds/updates translations
This commit is contained in:
2022-01-12 15:48:47 +01:00
parent dcc4e2fdc8
commit 1de3792d98
7 changed files with 112 additions and 14 deletions

View File

@@ -12,7 +12,8 @@ from abc import abstractmethod
from django.contrib import messages
from konova.tasks import celery_send_mail_shared_access_removed, celery_send_mail_shared_access_given, \
celery_send_mail_shared_data_recorded, celery_send_mail_shared_data_unrecorded, celery_send_mail_shared_data_deleted
celery_send_mail_shared_data_recorded, celery_send_mail_shared_data_unrecorded, \
celery_send_mail_shared_data_deleted, celery_send_mail_shared_data_checked
from user.models import User
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpRequest
@@ -324,6 +325,12 @@ class CheckableObjectMixin(models.Model):
action = UserActionLogEntry.get_checked_action(user)
self.checked = action
self.save()
# Send mail
shared_users = self.users.all().values_list("id", flat=True)
for user_id in shared_users:
celery_send_mail_shared_data_checked.delay(self.identifier, user_id)
self.log.add(action)
return action