diff --git a/intervention/forms/modalForms.py b/intervention/forms/modalForms.py index 39479388..1e5febf8 100644 --- a/intervention/forms/modalForms.py +++ b/intervention/forms/modalForms.py @@ -141,7 +141,7 @@ class ShareModalForm(BaseModalForm): self.load_initial_data(form_data) def save(self): - self.instance.update_sharing_user(self) + self.instance.update_shared_access(self) class NewRevocationModalForm(BaseModalForm): @@ -290,7 +290,9 @@ class CheckModalForm(BaseModalForm): Returns: """ - comps = self.instance.compensations.all() + comps = self.instance.compensations.filter( + deleted=None, + ) comps_valid = True for comp in comps: checker = comp.quality_check() diff --git a/konova/models/object.py b/konova/models/object.py index 92b3ccae..f224b68c 100644 --- a/konova/models/object.py +++ b/konova/models/object.py @@ -15,7 +15,10 @@ from django.db.models import QuerySet from konova.sub_settings.lanis_settings import DEFAULT_SRID_RLP, LANIS_ZOOM_LUT, LANIS_LINK_TEMPLATE 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_checked + celery_send_mail_shared_data_deleted, celery_send_mail_shared_data_checked, \ + celery_send_mail_shared_access_given_team, celery_send_mail_shared_access_removed_team, \ + celery_send_mail_shared_data_checked_team, celery_send_mail_shared_data_deleted_team, \ + celery_send_mail_shared_data_unrecorded_team, celery_send_mail_shared_data_recorded_team from django.core.exceptions import ObjectDoesNotExist from django.http import HttpRequest from django.utils.timezone import now @@ -130,6 +133,11 @@ class BaseObject(BaseResource): for user_id in shared_users: celery_send_mail_shared_data_deleted.delay(self.identifier, self.title, user_id) + # Send mail + shared_teams = self.shared_teams.values_list("id", flat=True) + for team_id in shared_teams: + celery_send_mail_shared_data_deleted_team.delay(self.identifier, self.title, team_id) + self.save() def mark_as_edited(self, performing_user, request: HttpRequest = None, edit_comment: str = None): @@ -258,10 +266,15 @@ class RecordableObjectMixin(models.Model): self.save() self.log.add(action) - shared_users = self.users.all().values_list("id", flat=True) + shared_users = self.shared_users.values_list("id", flat=True) + shared_teams = self.shared_teams.values_list("id", flat=True) + for user_id in shared_users: celery_send_mail_shared_data_unrecorded.delay(self.identifier, self.title, user_id) + for team_id in shared_teams: + celery_send_mail_shared_data_unrecorded_team.delay(self.identifier, self.title, team_id) + return action def set_recorded(self, user): @@ -281,10 +294,15 @@ class RecordableObjectMixin(models.Model): self.save() self.log.add(action) - shared_users = self.users.all().values_list("id", flat=True) + shared_users = self.shared_users.values_list("id", flat=True) + shared_teams = self.shared_teams.values_list("id", flat=True) + for user_id in shared_users: celery_send_mail_shared_data_recorded.delay(self.identifier, self.title, user_id) + for team_id in shared_teams: + celery_send_mail_shared_data_recorded_team.delay(self.identifier, self.title, team_id) + return action def unrecord(self, performing_user, request: HttpRequest = None): @@ -367,10 +385,15 @@ class CheckableObjectMixin(models.Model): self.save() # Send mail - shared_users = self.users.all().values_list("id", flat=True) + shared_users = self.shared_users.values_list("id", flat=True) for user_id in shared_users: celery_send_mail_shared_data_checked.delay(self.identifier, self.title, user_id) + # Send mail + shared_teams = self.shared_teams.values_list("id", flat=True) + for team_id in shared_teams: + celery_send_mail_shared_data_checked_team.delay(self.identifier, self.title, team_id) + self.log.add(action) return action @@ -488,8 +511,8 @@ class ShareableObjectMixin(models.Model): """ self.users.set(user_list) - def update_sharing_user(self, form): - """ Adds a new user with shared access to the object + def _update_shared_teams(self, form): + """ Updates shared access on the object for teams Args: form (ShareModalForm): The form holding the data @@ -497,33 +520,46 @@ class ShareableObjectMixin(models.Model): Returns: """ - from user.models import User form_data = form.cleaned_data + shared_teams = self.shared_teams # Fetch selected teams and find out which user IDs are in removed teams -> mails need to be sent accessing_teams = form_data["teams"] - removed_team_users = self.teams.all().exclude( + removed_teams = shared_teams.exclude( id__in=accessing_teams - ).values_list("users__id", flat=True) - accessing_team_users = User.objects.filter( - id__in=accessing_teams.values_list("users", flat=True) - ) - new_team_users = accessing_team_users.exclude( - id__in=self.shared_users ).values_list("id", flat=True) + new_teams = accessing_teams.exclude( + id__in=shared_teams + ).values_list("id", flat=True) + + for team_id in new_teams: + celery_send_mail_shared_access_given_team.delay(self.identifier, self.title, team_id) + for team_id in removed_teams: + celery_send_mail_shared_access_removed_team.delay(self.identifier, self.title, team_id) + + self.share_with_team_list(accessing_teams) + + def _update_shared_users(self, form): + """ Updates shared access on the object for single users + + Args: + form (ShareModalForm): The form holding the data + + Returns: + + """ + form_data = form.cleaned_data + shared_users = self.shared_users # Fetch selected users accessing_users = form_data["users"] - removed_users = self.users.all().exclude( + removed_users = shared_users.exclude( id__in=accessing_users ).values_list("id", flat=True) new_users = accessing_users.exclude( - id__in=self.shared_users + id__in=shared_users ).values_list("id", flat=True) - new_users = new_users.union(new_team_users) - removed_users = removed_users.union(removed_team_users) - # Send mails for user_id in removed_users: celery_send_mail_shared_access_removed.delay(self.identifier, self.title, user_id) @@ -532,7 +568,18 @@ class ShareableObjectMixin(models.Model): # Set new shared users self.share_with_user_list(accessing_users) - self.share_with_team_list(accessing_teams) + + def update_shared_access(self, form): + """ Updates shared access on the object + + Args: + form (ShareModalForm): The form holding the data + + Returns: + + """ + self._update_shared_teams(form) + self._update_shared_users(form) @property def shared_users(self) -> QuerySet: diff --git a/konova/tasks.py b/konova/tasks.py index c74a2bd7..798effb4 100644 --- a/konova/tasks.py +++ b/konova/tasks.py @@ -38,6 +38,20 @@ def celery_send_mail_shared_access_given(obj_identifier, obj_title=None, user_id user.send_mail_shared_access_given(obj_identifier, obj_title) +@shared_task +def celery_send_mail_shared_access_removed_team(obj_identifier, obj_title=None, team_id=None): + from user.models import Team + team = Team.objects.get(id=team_id) + team.send_mail_shared_access_removed(obj_identifier, obj_title) + + +@shared_task +def celery_send_mail_shared_access_given_team(obj_identifier, obj_title=None, team_id=None): + from user.models import Team + team = Team.objects.get(id=team_id) + team.send_mail_shared_access_given_team(obj_identifier, obj_title) + + @shared_task def celery_send_mail_shared_data_recorded(obj_identifier, obj_title=None, user_id=None): from user.models import User @@ -52,6 +66,20 @@ def celery_send_mail_shared_data_unrecorded(obj_identifier, obj_title=None, user user.send_mail_shared_data_unrecorded(obj_identifier, obj_title) +@shared_task +def celery_send_mail_shared_data_recorded_team(obj_identifier, obj_title=None, team_id=None): + from user.models import Team + team = Team.objects.get(id=team_id) + team.send_mail_shared_data_recorded(obj_identifier, obj_title) + + +@shared_task +def celery_send_mail_shared_data_unrecorded_team(obj_identifier, obj_title=None, team_id=None): + from user.models import Team + team = Team.objects.get(id=team_id) + team.send_mail_shared_data_unrecorded(obj_identifier, obj_title) + + @shared_task def celery_send_mail_shared_data_deleted(obj_identifier, obj_title=None, user_id=None): from user.models import User @@ -64,3 +92,17 @@ def celery_send_mail_shared_data_checked(obj_identifier, obj_title=None, user_id from user.models import User user = User.objects.get(id=user_id) user.send_mail_shared_data_checked(obj_identifier, obj_title) + + +@shared_task +def celery_send_mail_shared_data_deleted_team(obj_identifier, obj_title=None, team_id=None): + from user.models import Team + team = Team.objects.get(id=team_id) + team.send_mail_shared_data_deleted(obj_identifier, obj_title) + + +@shared_task +def celery_send_mail_shared_data_checked_team(obj_identifier, obj_title=None, team_id=None): + from user.models import Team + team = Team.objects.get(id=team_id) + team.send_mail_shared_data_checked(obj_identifier, obj_title) diff --git a/konova/utils/mailer.py b/konova/utils/mailer.py index 33907f3c..dd8eef1f 100644 --- a/konova/utils/mailer.py +++ b/konova/utils/mailer.py @@ -92,6 +92,144 @@ class Mailer: msg ) + def send_mail_shared_access_given_team(self, obj_identifier, obj_title, team): + """ Send a mail if a team just got access to the object + + Args: + obj_identifier (str): The object identifier + + Returns: + + """ + context = { + "team": team, + "obj_identifier": obj_identifier, + "obj_title": obj_title, + "EMAIL_REPLY_TO": EMAIL_REPLY_TO, + } + msg = render_to_string("email/sharing/shared_access_given_team.html", context) + user_mail_address = team.users.values_list("email", flat=True) + self.send( + user_mail_address, + _("{} - Shared access given").format(obj_identifier), + msg + ) + + def send_mail_shared_access_removed_team(self, obj_identifier, obj_title, team): + """ Send a mail if a team just lost access to the object + + Args: + obj_identifier (str): The object identifier + + Returns: + + """ + context = { + "team": team, + "obj_identifier": obj_identifier, + "obj_title": obj_title, + "EMAIL_REPLY_TO": EMAIL_REPLY_TO, + } + msg = render_to_string("email/sharing/shared_access_removed_team.html", context) + user_mail_address = team.users.values_list("email", flat=True) + self.send( + user_mail_address, + _("{} - Shared access removed").format(obj_identifier), + msg + ) + + def send_mail_shared_data_unrecorded_team(self, obj_identifier, obj_title, team): + """ Send a mail if data has just been unrecorded + + Args: + obj_identifier (str): The object identifier + + Returns: + + """ + context = { + "team": team, + "obj_identifier": obj_identifier, + "obj_title": obj_title, + "EMAIL_REPLY_TO": EMAIL_REPLY_TO, + } + msg = render_to_string("email/recording/shared_data_unrecorded_team.html", context) + user_mail_address = team.users.values_list("email", flat=True) + self.send( + user_mail_address, + _("{} - Shared data unrecorded").format(obj_identifier), + msg + ) + + def send_mail_shared_data_recorded_team(self, obj_identifier, obj_title, team): + """ Send a mail if data has just been recorded + + Args: + obj_identifier (str): The object identifier + + Returns: + + """ + context = { + "team": team, + "obj_identifier": obj_identifier, + "obj_title": obj_title, + "EMAIL_REPLY_TO": EMAIL_REPLY_TO, + } + msg = render_to_string("email/recording/shared_data_recorded_team.html", context) + user_mail_address = team.users.values_list("email", flat=True) + self.send( + user_mail_address, + _("{} - Shared data recorded").format(obj_identifier), + msg + ) + + def send_mail_shared_data_checked_team(self, obj_identifier, obj_title, team): + """ Send a mail if data has just been checked + + Args: + obj_identifier (str): The object identifier + + Returns: + + """ + context = { + "team": team, + "obj_identifier": obj_identifier, + "obj_title": obj_title, + "EMAIL_REPLY_TO": EMAIL_REPLY_TO, + } + msg = render_to_string("email/checking/shared_data_checked_team.html", context) + user_mail_address = team.users.values_list("email", flat=True) + self.send( + user_mail_address, + _("{} - Shared data checked").format(obj_identifier), + msg + ) + + def send_mail_shared_data_deleted_team(self, obj_identifier, obj_title, team): + """ Send a mail if data has just been deleted + + Args: + obj_identifier (str): The object identifier + + Returns: + + """ + context = { + "team": team, + "obj_identifier": obj_identifier, + "obj_title": obj_title, + "EMAIL_REPLY_TO": EMAIL_REPLY_TO, + } + msg = render_to_string("email/deleting/shared_data_deleted_team.html", context) + user_mail_address = team.users.values_list("email", flat=True) + self.send( + user_mail_address, + _("{} - Shared data deleted").format(obj_identifier), + msg + ) + def send_mail_shared_data_recorded(self, obj_identifier, obj_title, user): """ Send a mail if the user's shared data has just been unrecorded diff --git a/locale/de/LC_MESSAGES/django.mo b/locale/de/LC_MESSAGES/django.mo index ced4ab1c..9437cb99 100644 Binary files a/locale/de/LC_MESSAGES/django.mo and b/locale/de/LC_MESSAGES/django.mo differ diff --git a/locale/de/LC_MESSAGES/django.po b/locale/de/LC_MESSAGES/django.po index 94efbd7b..051894c4 100644 --- a/locale/de/LC_MESSAGES/django.po +++ b/locale/de/LC_MESSAGES/django.po @@ -26,7 +26,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-18 14:01+0100\n" +"POT-Creation-Date: 2022-02-18 14:50+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1796,27 +1796,27 @@ msgstr "In Zwischenablage kopiert" msgid "{} - Shared access removed" msgstr "{} - Zugriff entzogen" -#: konova/utils/mailer.py:91 +#: konova/utils/mailer.py:91 konova/utils/mailer.py:114 msgid "{} - Shared access given" msgstr "{} - Zugriff freigegeben" -#: konova/utils/mailer.py:114 +#: konova/utils/mailer.py:137 msgid "{} - Shared data recorded" msgstr "{} - Freigegebene Daten verzeichnet" -#: konova/utils/mailer.py:137 +#: konova/utils/mailer.py:160 msgid "{} - Shared data unrecorded" msgstr "{} - Freigegebene Daten entzeichnet" -#: konova/utils/mailer.py:160 +#: konova/utils/mailer.py:183 msgid "{} - Shared data deleted" msgstr "{} - Freigegebene Daten gelöscht" -#: konova/utils/mailer.py:183 +#: konova/utils/mailer.py:206 msgid "{} - Shared data checked" msgstr "{} - Freigegebene Daten geprüft" -#: konova/utils/mailer.py:204 templates/email/api/verify_token.html:4 +#: konova/utils/mailer.py:227 templates/email/api/verify_token.html:4 msgid "Request for new API token" msgstr "Anfrage für neuen API Token" @@ -2092,7 +2092,9 @@ msgstr "" #: templates/email/recording/shared_data_recorded.html:19 #: templates/email/recording/shared_data_unrecorded.html:19 #: templates/email/sharing/shared_access_given.html:20 +#: templates/email/sharing/shared_access_given_team.html:20 #: templates/email/sharing/shared_access_removed.html:20 +#: templates/email/sharing/shared_access_removed_team.html:20 msgid "Best regards" msgstr "Beste Grüße" @@ -2179,6 +2181,7 @@ msgstr "" "zugehörigen Kompensationen automatisch entzeichnet worden sind." #: templates/email/sharing/shared_access_given.html:4 +#: templates/email/sharing/shared_access_given_team.html:4 msgid "Access shared" msgstr "Zugriff freigegeben" @@ -2187,10 +2190,12 @@ msgid "the following dataset has just been shared with you" msgstr "der folgende Datensatz wurde soeben für Sie freigegeben " #: templates/email/sharing/shared_access_given.html:16 +#: templates/email/sharing/shared_access_given_team.html:16 msgid "This means you can now edit this dataset." msgstr "Das bedeutet, dass Sie diesen Datensatz nun auch bearbeiten können." #: templates/email/sharing/shared_access_given.html:17 +#: templates/email/sharing/shared_access_given_team.html:17 msgid "" "The shared dataset appears now by default on your overview for this dataset " "type." @@ -2199,6 +2204,7 @@ msgstr "" "Datensatztyp im KSP gelistet." #: templates/email/sharing/shared_access_given.html:27 +#: templates/email/sharing/shared_access_given_team.html:27 msgid "" "Please note: Shared access on an intervention means you automatically have " "editing access to related compensations." @@ -2207,7 +2213,17 @@ msgstr "" "Sie automatisch auch Zugriff auf die zugehörigen Kompensationen erhalten " "haben." +#: templates/email/sharing/shared_access_given_team.html:8 +#: templates/email/sharing/shared_access_removed_team.html:8 +msgid "Hello team" +msgstr "Hallo Team" + +#: templates/email/sharing/shared_access_given_team.html:10 +msgid "the following dataset has just been shared with your team" +msgstr "der folgende Datensatz wurde soeben für Ihr Team freigegeben " + #: templates/email/sharing/shared_access_removed.html:4 +#: templates/email/sharing/shared_access_removed_team.html:4 msgid "Shared access removed" msgstr "Freigegebener Zugriff entzogen" @@ -2219,10 +2235,12 @@ msgstr "" "entzogen: " #: templates/email/sharing/shared_access_removed.html:16 +#: templates/email/sharing/shared_access_removed_team.html:16 msgid "However, you are still able to view the dataset content." msgstr "Sie können den Datensatz aber immer noch im KSP einsehen." #: templates/email/sharing/shared_access_removed.html:17 +#: templates/email/sharing/shared_access_removed_team.html:17 msgid "" "Please use the provided search filter on the dataset`s overview pages to " "find them." @@ -2230,6 +2248,14 @@ msgstr "" "Nutzen Sie hierzu einfach die entsprechenden Suchfilter auf den " "Übersichtsseiten" +#: templates/email/sharing/shared_access_removed_team.html:10 +msgid "" +"your teams shared access, including editing, has been revoked for the " +"dataset " +msgstr "" +"Ihrem Team wurde soeben der bearbeitende Zugriff auf den folgenden Datensatz " +"entzogen: " + #: templates/email/signature.html:6 msgid "Please do not reply on this mail." msgstr "Bitte antworten Sie nicht auf diese Mail." @@ -4118,6 +4144,9 @@ msgstr "" msgid "Unable to connect to qpid with SASL mechanism %s" msgstr "" +#~ msgid "your teams" +#~ msgstr "Team entfernen" + #~ msgid "Remove check to remove access for this user" #~ msgstr "Wählen Sie die Nutzer ab, die keinen Zugriff mehr haben sollen" diff --git a/templates/email/checking/shared_data_checked_team.html b/templates/email/checking/shared_data_checked_team.html new file mode 100644 index 00000000..ee813811 --- /dev/null +++ b/templates/email/checking/shared_data_checked_team.html @@ -0,0 +1,28 @@ +{% load i18n %} + +
+

{% trans 'Shared data checked' %}

+

{{obj_identifier}}

+
+
+ {% trans 'Hello team' %} {{team.name}}, +
+ {% trans 'the following dataset has just been checked' %} +
+ {{obj_identifier}} +
+ {{obj_title}} +
+ {% trans 'This means, the responsible registration office just confirmed the correctness of this dataset.' %} +
+
+ {% trans 'Best regards' %} +
+ KSP +
+
+
+ {% include 'email/signature.html' %} +
+
+ diff --git a/templates/email/deleting/shared_data_deleted_team.html b/templates/email/deleting/shared_data_deleted_team.html new file mode 100644 index 00000000..cedb2a45 --- /dev/null +++ b/templates/email/deleting/shared_data_deleted_team.html @@ -0,0 +1,28 @@ +{% load i18n %} + +
+

{% trans 'Shared data deleted' %}

+

{{obj_identifier}}

+
+
+ {% trans 'Hello team' %} {{team.name}}, +
+ {% trans 'the following dataset has just been deleted' %} +
+ {{obj_identifier}} +
+ "{{obj_title}}" +
+ {% trans 'If this should not have been happened, please contact us. See the signature for details.' %} +
+
+ {% trans 'Best regards' %} +
+ KSP +
+
+
+ {% include 'email/signature.html' %} +
+
+ diff --git a/templates/email/recording/shared_data_recorded_team.html b/templates/email/recording/shared_data_recorded_team.html new file mode 100644 index 00000000..12efa8f6 --- /dev/null +++ b/templates/email/recording/shared_data_recorded_team.html @@ -0,0 +1,33 @@ +{% load i18n %} + +
+

{% trans 'Shared data recorded' %}

+

{{obj_identifier}}

+
+
+ {% trans 'Hello team' %} {{team.name}}, +
+ {% trans 'the following dataset has just been recorded' %} +
+ {{obj_identifier}} +
+ "{{obj_title}}" +
+ {% trans 'This means the data is now publicly available, e.g. in LANIS' %} +
+
+ {% trans 'Best regards' %} +
+ KSP +
+
+
+ + {% trans 'Please note: Recorded intervention means the compensations are recorded as well.' %} + +
+
+ {% include 'email/signature.html' %} +
+
+ diff --git a/templates/email/recording/shared_data_unrecorded_team.html b/templates/email/recording/shared_data_unrecorded_team.html new file mode 100644 index 00000000..64141555 --- /dev/null +++ b/templates/email/recording/shared_data_unrecorded_team.html @@ -0,0 +1,33 @@ +{% load i18n %} + +
+

{% trans 'Shared data unrecorded' %}

+

{{obj_identifier}}

+
+
+ {% trans 'Hello team' %} {{team.name}}, +
+ {% trans 'the following dataset has just been unrecorded' %} +
+ {{obj_identifier}} +
+ "{{obj_title}}" +
+ {% trans 'This means the data is no longer publicly available.' %} +
+
+ {% trans 'Best regards' %} +
+ KSP +
+
+
+ + {% trans 'Please note: Unrecorded intervention means the compensations are unrecorded as well.' %} + +
+
+ {% include 'email/signature.html' %} +
+
+ diff --git a/templates/email/sharing/shared_access_given_team.html b/templates/email/sharing/shared_access_given_team.html new file mode 100644 index 00000000..990ba2de --- /dev/null +++ b/templates/email/sharing/shared_access_given_team.html @@ -0,0 +1,34 @@ +{% load i18n %} + +
+

{% trans 'Access shared' %}

+

{{obj_identifier}}

+
+
+ {% trans 'Hello team' %} {{team.name}}, +
+ {% trans 'the following dataset has just been shared with your team' %} +
+ {{obj_identifier}} +
+ "{{obj_title}}" +
+ {% trans 'This means you can now edit this dataset.' %} + {% trans 'The shared dataset appears now by default on your overview for this dataset type.' %} +
+
+ {% trans 'Best regards' %} +
+ KSP +
+
+
+ + {% trans 'Please note: Shared access on an intervention means you automatically have editing access to related compensations.' %} + +
+
+ {% include 'email/signature.html' %} +
+
+ diff --git a/templates/email/sharing/shared_access_removed_team.html b/templates/email/sharing/shared_access_removed_team.html new file mode 100644 index 00000000..5472ef73 --- /dev/null +++ b/templates/email/sharing/shared_access_removed_team.html @@ -0,0 +1,29 @@ +{% load i18n %} + +
+

{% trans 'Shared access removed' %}

+

{{obj_identifier}}

+
+
+ {% trans 'Hello team' %} {{team.name}}, +
+ {% trans 'your teams shared access, including editing, has been revoked for the dataset ' %} +
+ {{obj_identifier}} +
+ "{{obj_title}}" +
+ {% trans 'However, you are still able to view the dataset content.' %} + {% trans 'Please use the provided search filter on the dataset`s overview pages to find them.' %} +
+
+ {% trans 'Best regards' %} +
+ KSP +
+
+
+ {% include 'email/signature.html' %} +
+
+ diff --git a/user/models/team.py b/user/models/team.py index c26af3c6..e36c95b4 100644 --- a/user/models/team.py +++ b/user/models/team.py @@ -1,6 +1,7 @@ from django.db import models from konova.models import UuidModel +from konova.utils.mailer import Mailer class Team(UuidModel): @@ -14,3 +15,81 @@ class Team(UuidModel): def __str__(self): return self.name + + def send_mail_shared_access_given_team(self, obj_identifier, obj_title): + """ Sends a mail to the team members in case of given shared access + + Args: + obj_identifier (): + obj_title (): + + Returns: + + """ + mailer = Mailer() + mailer.send_mail_shared_access_given_team(obj_identifier, obj_title, self) + + def send_mail_shared_access_removed(self, obj_identifier, obj_title): + """ Sends a mail to the team members in case of removed shared access + + Args: + obj_identifier (): + obj_title (): + + Returns: + + """ + mailer = Mailer() + mailer.send_mail_shared_access_removed_team(obj_identifier, obj_title, self) + + def send_mail_shared_data_unrecorded(self, obj_identifier, obj_title): + """ Sends a mail to the team members in case of unrecorded data + + Args: + obj_identifier (): + obj_title (): + + Returns: + + """ + mailer = Mailer() + mailer.send_mail_shared_data_unrecorded_team(obj_identifier, obj_title, self) + + def send_mail_shared_data_recorded(self, obj_identifier, obj_title): + """ Sends a mail to the team members in case of unrecorded data + + Args: + obj_identifier (): + obj_title (): + + Returns: + + """ + mailer = Mailer() + mailer.send_mail_shared_data_recorded_team(obj_identifier, obj_title, self) + + def send_mail_shared_data_checked(self, obj_identifier, obj_title): + """ Sends a mail to the team members in case of checked data + + Args: + obj_identifier (): + obj_title (): + + Returns: + + """ + mailer = Mailer() + mailer.send_mail_shared_data_checked_team(obj_identifier, obj_title, self) + + def send_mail_shared_data_deleted(self, obj_identifier, obj_title): + """ Sends a mail to the team members in case of deleted data + + Args: + obj_identifier (): + obj_title (): + + Returns: + + """ + mailer = Mailer() + mailer.send_mail_shared_data_deleted_team(obj_identifier, obj_title, self)