# 63 Mail recording/unrecording
* adds mail sending in case of unrecording and recording of data * adds/updates translations
This commit is contained in:
@@ -11,7 +11,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
|
||||
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
|
||||
from user.models import User
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from django.http import HttpRequest
|
||||
@@ -218,6 +219,11 @@ class RecordableObjectMixin(models.Model):
|
||||
self.recorded = None
|
||||
self.save()
|
||||
self.log.add(action)
|
||||
|
||||
shared_users = self.users.all().values_list("id", flat=True)
|
||||
for user_id in shared_users:
|
||||
celery_send_mail_shared_data_unrecorded(self.identifier, user_id)
|
||||
|
||||
return action
|
||||
|
||||
def set_recorded(self, user: User):
|
||||
@@ -235,6 +241,11 @@ class RecordableObjectMixin(models.Model):
|
||||
self.recorded = action
|
||||
self.save()
|
||||
self.log.add(action)
|
||||
|
||||
shared_users = self.users.all().values_list("id", flat=True)
|
||||
for user_id in shared_users:
|
||||
celery_send_mail_shared_data_recorded(self.identifier, user_id)
|
||||
|
||||
return action
|
||||
|
||||
def mark_as_edited(self, performing_user: User, request: HttpRequest = None, edit_comment: str = None):
|
||||
|
||||
Reference in New Issue
Block a user