Merge pull request '191_Deduction_change_notification' (#195) from 191_Deduction_change_notification into master
Reviewed-on: SGD-Nord/konova#195
This commit is contained in:
		
						commit
						982d9f1930
					
				@ -21,6 +21,7 @@ from compensation.models.compensation import AbstractCompensation, PikMixin
 | 
			
		||||
from compensation.utils.quality import EcoAccountQualityChecker
 | 
			
		||||
from konova.models import ShareableObjectMixin, RecordableObjectMixin, AbstractDocument, BaseResource, \
 | 
			
		||||
    generate_document_file_upload_path
 | 
			
		||||
from konova.tasks import celery_send_mail_deduction_changed, celery_send_mail_deduction_changed_team
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class EcoAccount(AbstractCompensation, ShareableObjectMixin, RecordableObjectMixin, PikMixin):
 | 
			
		||||
@ -161,6 +162,25 @@ class EcoAccount(AbstractCompensation, ShareableObjectMixin, RecordableObjectMix
 | 
			
		||||
        """
 | 
			
		||||
        return reverse("compensation:acc:share", args=(self.id, self.access_token))
 | 
			
		||||
 | 
			
		||||
    def send_notification_mail_on_deduction_change(self, data_change: dict):
 | 
			
		||||
        """ Sends notification mails for changes on the deduction
 | 
			
		||||
 | 
			
		||||
        Args:
 | 
			
		||||
            data_change ():
 | 
			
		||||
 | 
			
		||||
        Returns:
 | 
			
		||||
 | 
			
		||||
        """
 | 
			
		||||
        # Send mail
 | 
			
		||||
        shared_users = self.shared_users.values_list("id", flat=True)
 | 
			
		||||
        for user_id in shared_users:
 | 
			
		||||
            celery_send_mail_deduction_changed.delay(self.identifier, self.title, user_id, data_change)
 | 
			
		||||
 | 
			
		||||
        # Send mail
 | 
			
		||||
        shared_teams = self.shared_teams.values_list("id", flat=True)
 | 
			
		||||
        for team_id in shared_teams:
 | 
			
		||||
            celery_send_mail_deduction_changed_team.delay(self.identifier, self.title, team_id, data_change)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class EcoAccountDocument(AbstractDocument):
 | 
			
		||||
    """
 | 
			
		||||
@ -251,4 +271,4 @@ class EcoAccountDeduction(BaseResource):
 | 
			
		||||
        if user is not None:
 | 
			
		||||
            self.intervention.mark_as_edited(user, edit_comment=DEDUCTION_REMOVED)
 | 
			
		||||
            self.account.mark_as_edited(user, edit_comment=DEDUCTION_REMOVED)
 | 
			
		||||
        super().delete(*args, **kwargs)
 | 
			
		||||
        super().delete(*args, **kwargs)
 | 
			
		||||
 | 
			
		||||
@ -508,28 +508,44 @@ class EditEcoAccountDeductionModalForm(NewDeductionModalForm):
 | 
			
		||||
        deduction = self.deduction
 | 
			
		||||
        form_account = self.cleaned_data.get("account", None)
 | 
			
		||||
        form_intervention = self.cleaned_data.get("intervention", None)
 | 
			
		||||
        current_account = deduction.account
 | 
			
		||||
        current_intervention = deduction.intervention
 | 
			
		||||
 | 
			
		||||
        old_account = deduction.account
 | 
			
		||||
        old_intervention = deduction.intervention
 | 
			
		||||
        old_surface = deduction.surface
 | 
			
		||||
 | 
			
		||||
        # If account or intervention has been changed, we put that change in the logs just as if the deduction has
 | 
			
		||||
        # been removed for this entry. Act as if the deduction is newly created for the new entries
 | 
			
		||||
        if current_account != form_account:
 | 
			
		||||
            current_account.mark_as_edited(self.user, self.request, edit_comment=DEDUCTION_REMOVED)
 | 
			
		||||
        if old_account != form_account:
 | 
			
		||||
            old_account.mark_as_edited(self.user, self.request, edit_comment=DEDUCTION_REMOVED)
 | 
			
		||||
            form_account.mark_as_edited(self.user, self.request, edit_comment=DEDUCTION_ADDED)
 | 
			
		||||
        else:
 | 
			
		||||
            current_account.mark_as_edited(self.user, self.request, edit_comment=DEDUCTION_EDITED)
 | 
			
		||||
            old_account.mark_as_edited(self.user, self.request, edit_comment=DEDUCTION_EDITED)
 | 
			
		||||
 | 
			
		||||
        if current_intervention != form_intervention:
 | 
			
		||||
            current_intervention.mark_as_edited(self.user, self.request, edit_comment=DEDUCTION_REMOVED)
 | 
			
		||||
        if old_intervention != form_intervention:
 | 
			
		||||
            old_intervention.mark_as_edited(self.user, self.request, edit_comment=DEDUCTION_REMOVED)
 | 
			
		||||
            form_intervention.mark_as_edited(self.user, self.request, edit_comment=DEDUCTION_ADDED)
 | 
			
		||||
        else:
 | 
			
		||||
            current_intervention.mark_as_edited(self.user, self.request, edit_comment=DEDUCTION_EDITED)
 | 
			
		||||
            old_intervention.mark_as_edited(self.user, self.request, edit_comment=DEDUCTION_EDITED)
 | 
			
		||||
 | 
			
		||||
        deduction.account = form_account
 | 
			
		||||
        deduction.intervention = self.cleaned_data.get("intervention", None)
 | 
			
		||||
        deduction.surface = self.cleaned_data.get("surface", None)
 | 
			
		||||
        deduction.save()
 | 
			
		||||
 | 
			
		||||
        data_changes = {
 | 
			
		||||
            "surface": {
 | 
			
		||||
                "old": old_surface,
 | 
			
		||||
                "new": deduction.surface,
 | 
			
		||||
            },
 | 
			
		||||
            "intervention": {
 | 
			
		||||
                "old": old_intervention.identifier,
 | 
			
		||||
                "new": deduction.intervention.identifier,
 | 
			
		||||
            },
 | 
			
		||||
            "account": {
 | 
			
		||||
                "old": old_account.identifier,
 | 
			
		||||
                "new": deduction.account.identifier,
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        old_account.send_notification_mail_on_deduction_change(data_changes)
 | 
			
		||||
        return deduction
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -28,4 +28,5 @@ USER_NOTIFICATIONS_NAMES = {
 | 
			
		||||
    "NOTIFY_ON_SHARED_DATA_RECORDED": _("On shared data recorded"),
 | 
			
		||||
    "NOTIFY_ON_SHARED_DATA_DELETED": _("On shared data deleted"),
 | 
			
		||||
    "NOTIFY_ON_SHARED_DATA_CHECKED": _("On shared data checked"),
 | 
			
		||||
}
 | 
			
		||||
    "NOTIFY_ON_DEDUCTION_CHANGES": _("On deduction changes"),
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -106,3 +106,17 @@ def celery_send_mail_shared_data_checked_team(obj_identifier, obj_title=None, te
 | 
			
		||||
    from user.models import Team
 | 
			
		||||
    team = Team.objects.get(id=team_id)
 | 
			
		||||
    team.send_mail_shared_data_checked(obj_identifier, obj_title)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@shared_task
 | 
			
		||||
def celery_send_mail_deduction_changed_team(obj_identifier, obj_title=None, team_id=None, data_changes=None):
 | 
			
		||||
    from user.models import Team
 | 
			
		||||
    team = Team.objects.get(id=team_id)
 | 
			
		||||
    team.send_mail_deduction_changed(obj_identifier, obj_title, data_changes)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@shared_task
 | 
			
		||||
def celery_send_mail_deduction_changed(obj_identifier, obj_title=None, user_id=None, data_changes=None):
 | 
			
		||||
    from user.models import User
 | 
			
		||||
    user = User.objects.get(id=user_id)
 | 
			
		||||
    user.send_mail_deduction_changed(obj_identifier, obj_title, data_changes)
 | 
			
		||||
 | 
			
		||||
@ -207,6 +207,33 @@ class Mailer:
 | 
			
		||||
            msg
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
    def send_mail_deduction_changed_team(self, obj_identifier, obj_title, team, data_changes):
 | 
			
		||||
        """ Send a mail if deduction has been changed
 | 
			
		||||
 | 
			
		||||
        Args:
 | 
			
		||||
            obj_identifier (str): Identifier of the main object
 | 
			
		||||
            obj_title (str): Title of the main object
 | 
			
		||||
            team (Team): Team to be notified
 | 
			
		||||
            data_changes (dict): Contains the old|new changes of the deduction changes
 | 
			
		||||
 | 
			
		||||
        Returns:
 | 
			
		||||
 | 
			
		||||
        """
 | 
			
		||||
        context = {
 | 
			
		||||
            "team": team,
 | 
			
		||||
            "obj_identifier": obj_identifier,
 | 
			
		||||
            "obj_title": obj_title,
 | 
			
		||||
            "EMAIL_REPLY_TO": EMAIL_REPLY_TO,
 | 
			
		||||
            "data_changes": data_changes,
 | 
			
		||||
        }
 | 
			
		||||
        msg = render_to_string("email/other/deduction_changed_team.html", context)
 | 
			
		||||
        user_mail_address = team.users.values_list("email", flat=True)
 | 
			
		||||
        self.send(
 | 
			
		||||
            user_mail_address,
 | 
			
		||||
            _("{} - Deduction changed").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
 | 
			
		||||
 | 
			
		||||
@ -322,6 +349,34 @@ class Mailer:
 | 
			
		||||
            msg
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
    def send_mail_deduction_changed(self, obj_identifier, obj_title, user, data_changes):
 | 
			
		||||
        """ Send a mail if deduction has been changed
 | 
			
		||||
 | 
			
		||||
        Args:
 | 
			
		||||
            obj_identifier (str): Identifier of the main object
 | 
			
		||||
            obj_title (str): Title of the main object
 | 
			
		||||
            user (User): User to be notified
 | 
			
		||||
            data_changes (dict): Contains the old|new changes of the deduction changes
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        Returns:
 | 
			
		||||
 | 
			
		||||
        """
 | 
			
		||||
        context = {
 | 
			
		||||
            "user": user,
 | 
			
		||||
            "obj_identifier": obj_identifier,
 | 
			
		||||
            "obj_title": obj_title,
 | 
			
		||||
            "EMAIL_REPLY_TO": EMAIL_REPLY_TO,
 | 
			
		||||
            "data_changes": data_changes,
 | 
			
		||||
        }
 | 
			
		||||
        msg = render_to_string("email/other/deduction_changed.html", context)
 | 
			
		||||
        user_mail_address = [user.email]
 | 
			
		||||
        self.send(
 | 
			
		||||
            user_mail_address,
 | 
			
		||||
            _("{} - Deduction changed").format(obj_identifier),
 | 
			
		||||
            msg
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
    def send_mail_verify_api_token(self, user):
 | 
			
		||||
        """ Send a mail if a user creates a new token
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
										
											Binary file not shown.
										
									
								
							@ -26,7 +26,7 @@ msgid ""
 | 
			
		||||
msgstr ""
 | 
			
		||||
"Project-Id-Version: PACKAGE VERSION\n"
 | 
			
		||||
"Report-Msgid-Bugs-To: \n"
 | 
			
		||||
"POT-Creation-Date: 2022-08-08 14:39+0200\n"
 | 
			
		||||
"POT-Creation-Date: 2022-08-10 08:37+0200\n"
 | 
			
		||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 | 
			
		||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 | 
			
		||||
"Language-Team: LANGUAGE <LL@li.org>\n"
 | 
			
		||||
@ -55,7 +55,7 @@ msgstr "Einträge erstellt bis..."
 | 
			
		||||
#: analysis/forms.py:49 compensation/forms/forms.py:77
 | 
			
		||||
#: compensation/templates/compensation/detail/eco_account/view.html:59
 | 
			
		||||
#: compensation/templates/compensation/report/eco_account/report.html:16
 | 
			
		||||
#: compensation/utils/quality.py:113 ema/templates/ema/detail/view.html:49
 | 
			
		||||
#: compensation/utils/quality.py:111 ema/templates/ema/detail/view.html:49
 | 
			
		||||
#: ema/templates/ema/report/report.html:16 ema/utils/quality.py:26
 | 
			
		||||
#: intervention/forms/forms.py:102
 | 
			
		||||
#: intervention/templates/intervention/detail/view.html:56
 | 
			
		||||
@ -241,6 +241,7 @@ msgstr ""
 | 
			
		||||
#: ema/templates/ema/detail/includes/states-after.html:36
 | 
			
		||||
#: ema/templates/ema/detail/includes/states-before.html:36
 | 
			
		||||
#: intervention/forms/modalForms.py:364
 | 
			
		||||
#: templates/email/other/deduction_changed.html:29
 | 
			
		||||
msgid "Surface"
 | 
			
		||||
msgstr "Fläche"
 | 
			
		||||
 | 
			
		||||
@ -297,8 +298,8 @@ msgstr "Gesetz"
 | 
			
		||||
 | 
			
		||||
#: analysis/templates/analysis/reports/includes/old_data/amount.html:17
 | 
			
		||||
#: compensation/templates/compensation/detail/compensation/includes/deadlines.html:33
 | 
			
		||||
#: compensation/templates/compensation/detail/eco_account/includes/deadlines.html:28
 | 
			
		||||
#: ema/templates/ema/detail/includes/deadlines.html:28
 | 
			
		||||
#: compensation/templates/compensation/detail/eco_account/includes/deadlines.html:33
 | 
			
		||||
#: ema/templates/ema/detail/includes/deadlines.html:33
 | 
			
		||||
msgid "Type"
 | 
			
		||||
msgstr "Typ"
 | 
			
		||||
 | 
			
		||||
@ -307,6 +308,7 @@ msgstr "Typ"
 | 
			
		||||
#: intervention/forms/modalForms.py:382 intervention/tables.py:87
 | 
			
		||||
#: intervention/templates/intervention/detail/view.html:19
 | 
			
		||||
#: konova/templates/konova/includes/quickstart/interventions.html:4
 | 
			
		||||
#: templates/email/other/deduction_changed.html:24
 | 
			
		||||
#: templates/navbars/navbar.html:22
 | 
			
		||||
msgid "Intervention"
 | 
			
		||||
msgstr "Eingriff"
 | 
			
		||||
@ -378,10 +380,10 @@ msgstr "Kompensation XY; Flur ABC"
 | 
			
		||||
#: compensation/templates/compensation/detail/compensation/includes/deadlines.html:39
 | 
			
		||||
#: compensation/templates/compensation/detail/compensation/includes/documents.html:34
 | 
			
		||||
#: compensation/templates/compensation/detail/eco_account/includes/actions.html:34
 | 
			
		||||
#: compensation/templates/compensation/detail/eco_account/includes/deadlines.html:34
 | 
			
		||||
#: compensation/templates/compensation/detail/eco_account/includes/deadlines.html:39
 | 
			
		||||
#: compensation/templates/compensation/detail/eco_account/includes/documents.html:34
 | 
			
		||||
#: ema/templates/ema/detail/includes/actions.html:34
 | 
			
		||||
#: ema/templates/ema/detail/includes/deadlines.html:34
 | 
			
		||||
#: ema/templates/ema/detail/includes/deadlines.html:39
 | 
			
		||||
#: ema/templates/ema/detail/includes/documents.html:34
 | 
			
		||||
#: intervention/forms/forms.py:198 intervention/forms/modalForms.py:175
 | 
			
		||||
#: intervention/templates/intervention/detail/includes/documents.html:34
 | 
			
		||||
@ -399,7 +401,7 @@ msgstr "Zusätzlicher Kommentar"
 | 
			
		||||
#: compensation/forms/forms.py:93
 | 
			
		||||
#: compensation/templates/compensation/detail/eco_account/view.html:63
 | 
			
		||||
#: compensation/templates/compensation/report/eco_account/report.html:20
 | 
			
		||||
#: compensation/utils/quality.py:115 ema/templates/ema/detail/view.html:53
 | 
			
		||||
#: compensation/utils/quality.py:113 ema/templates/ema/detail/view.html:53
 | 
			
		||||
#: ema/templates/ema/report/report.html:20 ema/utils/quality.py:28
 | 
			
		||||
#: intervention/forms/forms.py:130
 | 
			
		||||
#: intervention/templates/intervention/detail/view.html:60
 | 
			
		||||
@ -485,7 +487,7 @@ msgstr "Neue Kompensation"
 | 
			
		||||
msgid "Edit compensation"
 | 
			
		||||
msgstr "Bearbeite Kompensation"
 | 
			
		||||
 | 
			
		||||
#: compensation/forms/forms.py:356 compensation/utils/quality.py:97
 | 
			
		||||
#: compensation/forms/forms.py:356 compensation/utils/quality.py:95
 | 
			
		||||
msgid "Available Surface"
 | 
			
		||||
msgstr "Verfügbare Fläche"
 | 
			
		||||
 | 
			
		||||
@ -495,7 +497,7 @@ msgstr "Die für Abbuchungen zur Verfügung stehende Menge"
 | 
			
		||||
 | 
			
		||||
#: compensation/forms/forms.py:368
 | 
			
		||||
#: compensation/templates/compensation/detail/eco_account/view.html:67
 | 
			
		||||
#: compensation/utils/quality.py:85
 | 
			
		||||
#: compensation/utils/quality.py:83
 | 
			
		||||
msgid "Agreement date"
 | 
			
		||||
msgstr "Vereinbarungsdatum"
 | 
			
		||||
 | 
			
		||||
@ -598,8 +600,8 @@ msgstr "Fristart wählen"
 | 
			
		||||
 | 
			
		||||
#: compensation/forms/modalForms.py:345
 | 
			
		||||
#: compensation/templates/compensation/detail/compensation/includes/deadlines.html:36
 | 
			
		||||
#: compensation/templates/compensation/detail/eco_account/includes/deadlines.html:31
 | 
			
		||||
#: ema/templates/ema/detail/includes/deadlines.html:31
 | 
			
		||||
#: compensation/templates/compensation/detail/eco_account/includes/deadlines.html:36
 | 
			
		||||
#: ema/templates/ema/detail/includes/deadlines.html:36
 | 
			
		||||
#: intervention/forms/modalForms.py:149
 | 
			
		||||
msgid "Date"
 | 
			
		||||
msgstr "Datum"
 | 
			
		||||
@ -618,8 +620,8 @@ msgstr "Geben Sie die Daten der neuen Frist ein"
 | 
			
		||||
 | 
			
		||||
#: compensation/forms/modalForms.py:389
 | 
			
		||||
#: compensation/templates/compensation/detail/compensation/includes/deadlines.html:64
 | 
			
		||||
#: compensation/templates/compensation/detail/eco_account/includes/deadlines.html:57
 | 
			
		||||
#: ema/templates/ema/detail/includes/deadlines.html:57
 | 
			
		||||
#: compensation/templates/compensation/detail/eco_account/includes/deadlines.html:62
 | 
			
		||||
#: ema/templates/ema/detail/includes/deadlines.html:62
 | 
			
		||||
msgid "Edit deadline"
 | 
			
		||||
msgstr "Frist/Termin bearbeiten"
 | 
			
		||||
 | 
			
		||||
@ -696,14 +698,14 @@ msgstr ""
 | 
			
		||||
msgid "Pieces"
 | 
			
		||||
msgstr "Stück"
 | 
			
		||||
 | 
			
		||||
#: compensation/models/eco_account.py:55
 | 
			
		||||
#: compensation/models/eco_account.py:56
 | 
			
		||||
msgid ""
 | 
			
		||||
"Deductable surface can not be larger than existing surfaces in after states"
 | 
			
		||||
msgstr ""
 | 
			
		||||
"Die abbuchbare Fläche darf die Gesamtfläche der Zielzustände nicht "
 | 
			
		||||
"überschreiten"
 | 
			
		||||
 | 
			
		||||
#: compensation/models/eco_account.py:62
 | 
			
		||||
#: compensation/models/eco_account.py:63
 | 
			
		||||
msgid ""
 | 
			
		||||
"Deductable surface can not be smaller than the sum of already existing "
 | 
			
		||||
"deductions. Please contact the responsible users for the deductions!"
 | 
			
		||||
@ -803,13 +805,13 @@ msgstr "Menge"
 | 
			
		||||
#: compensation/templates/compensation/detail/compensation/includes/states-after.html:41
 | 
			
		||||
#: compensation/templates/compensation/detail/compensation/includes/states-before.html:41
 | 
			
		||||
#: compensation/templates/compensation/detail/eco_account/includes/actions.html:39
 | 
			
		||||
#: compensation/templates/compensation/detail/eco_account/includes/deadlines.html:38
 | 
			
		||||
#: compensation/templates/compensation/detail/eco_account/includes/deadlines.html:43
 | 
			
		||||
#: compensation/templates/compensation/detail/eco_account/includes/deductions.html:41
 | 
			
		||||
#: compensation/templates/compensation/detail/eco_account/includes/documents.html:38
 | 
			
		||||
#: compensation/templates/compensation/detail/eco_account/includes/states-after.html:41
 | 
			
		||||
#: compensation/templates/compensation/detail/eco_account/includes/states-before.html:41
 | 
			
		||||
#: ema/templates/ema/detail/includes/actions.html:38
 | 
			
		||||
#: ema/templates/ema/detail/includes/deadlines.html:38
 | 
			
		||||
#: ema/templates/ema/detail/includes/deadlines.html:43
 | 
			
		||||
#: ema/templates/ema/detail/includes/documents.html:38
 | 
			
		||||
#: ema/templates/ema/detail/includes/states-after.html:40
 | 
			
		||||
#: ema/templates/ema/detail/includes/states-before.html:40
 | 
			
		||||
@ -883,12 +885,14 @@ msgid "Add new deadline"
 | 
			
		||||
msgstr "Frist/Termin hinzufügen"
 | 
			
		||||
 | 
			
		||||
#: compensation/templates/compensation/detail/compensation/includes/deadlines.html:25
 | 
			
		||||
#: compensation/templates/compensation/detail/eco_account/includes/deadlines.html:25
 | 
			
		||||
#: ema/templates/ema/detail/includes/deadlines.html:25
 | 
			
		||||
msgid "Missing finished deadline "
 | 
			
		||||
msgstr "Umsetzungstermin fehlt"
 | 
			
		||||
 | 
			
		||||
#: compensation/templates/compensation/detail/compensation/includes/deadlines.html:67
 | 
			
		||||
#: compensation/templates/compensation/detail/eco_account/includes/deadlines.html:60
 | 
			
		||||
#: ema/templates/ema/detail/includes/deadlines.html:60
 | 
			
		||||
#: compensation/templates/compensation/detail/eco_account/includes/deadlines.html:65
 | 
			
		||||
#: ema/templates/ema/detail/includes/deadlines.html:65
 | 
			
		||||
msgid "Remove deadline"
 | 
			
		||||
msgstr "Frist löschen"
 | 
			
		||||
 | 
			
		||||
@ -932,7 +936,7 @@ msgstr "Dokument löschen"
 | 
			
		||||
 | 
			
		||||
#: compensation/templates/compensation/detail/compensation/includes/states-after.html:8
 | 
			
		||||
#: compensation/templates/compensation/detail/eco_account/includes/states-after.html:8
 | 
			
		||||
#: compensation/utils/quality.py:42
 | 
			
		||||
#: compensation/utils/quality.py:40
 | 
			
		||||
#: ema/templates/ema/detail/includes/states-after.html:8
 | 
			
		||||
msgid "States after"
 | 
			
		||||
msgstr "Zielzustand"
 | 
			
		||||
@ -978,7 +982,7 @@ msgstr "Zustand entfernen"
 | 
			
		||||
 | 
			
		||||
#: compensation/templates/compensation/detail/compensation/includes/states-before.html:8
 | 
			
		||||
#: compensation/templates/compensation/detail/eco_account/includes/states-before.html:8
 | 
			
		||||
#: compensation/utils/quality.py:40
 | 
			
		||||
#: compensation/utils/quality.py:38
 | 
			
		||||
#: ema/templates/ema/detail/includes/states-before.html:8
 | 
			
		||||
msgid "States before"
 | 
			
		||||
msgstr "Ausgangszustand"
 | 
			
		||||
@ -1188,25 +1192,25 @@ msgstr "Abbuchungen für"
 | 
			
		||||
msgid "None"
 | 
			
		||||
msgstr "-"
 | 
			
		||||
 | 
			
		||||
#: compensation/utils/quality.py:37
 | 
			
		||||
#: compensation/utils/quality.py:35
 | 
			
		||||
msgid "States unequal"
 | 
			
		||||
msgstr "Ungleiche Zustandsflächenmengen"
 | 
			
		||||
 | 
			
		||||
#: compensation/utils/quality.py:61
 | 
			
		||||
#: compensation/utils/quality.py:59
 | 
			
		||||
msgid "Finished deadlines"
 | 
			
		||||
msgstr "Umsetzungstermin"
 | 
			
		||||
 | 
			
		||||
#: compensation/utils/quality.py:87 intervention/utils/quality.py:84
 | 
			
		||||
#: compensation/utils/quality.py:85 intervention/utils/quality.py:84
 | 
			
		||||
msgid "Legal data"
 | 
			
		||||
msgstr "Rechtliche Daten"
 | 
			
		||||
 | 
			
		||||
#: compensation/utils/quality.py:101
 | 
			
		||||
#: compensation/utils/quality.py:99
 | 
			
		||||
msgid "Deductable surface can not be larger than state surface"
 | 
			
		||||
msgstr ""
 | 
			
		||||
"Die abbuchbare Fläche darf die Gesamtfläche der Zielzustände nicht "
 | 
			
		||||
"überschreiten"
 | 
			
		||||
 | 
			
		||||
#: compensation/utils/quality.py:117 ema/utils/quality.py:30
 | 
			
		||||
#: compensation/utils/quality.py:115 ema/utils/quality.py:30
 | 
			
		||||
#: intervention/utils/quality.py:55
 | 
			
		||||
msgid "Responsible data"
 | 
			
		||||
msgstr "Daten zu den verantwortlichen Stellen"
 | 
			
		||||
@ -1220,17 +1224,17 @@ msgid "Compensation {} edited"
 | 
			
		||||
msgstr "Kompensation {} bearbeitet"
 | 
			
		||||
 | 
			
		||||
#: compensation/views/compensation.py:182 compensation/views/eco_account.py:173
 | 
			
		||||
#: ema/views.py:240 intervention/views.py:338
 | 
			
		||||
#: ema/views.py:241 intervention/views.py:338
 | 
			
		||||
msgid "Edit {}"
 | 
			
		||||
msgstr "Bearbeite {}"
 | 
			
		||||
 | 
			
		||||
#: compensation/views/compensation.py:269 compensation/views/eco_account.py:359
 | 
			
		||||
#: ema/views.py:194 intervention/views.py:542
 | 
			
		||||
#: compensation/views/compensation.py:269 compensation/views/eco_account.py:360
 | 
			
		||||
#: ema/views.py:195 intervention/views.py:542
 | 
			
		||||
msgid "Log"
 | 
			
		||||
msgstr "Log"
 | 
			
		||||
 | 
			
		||||
#: compensation/views/compensation.py:613 compensation/views/eco_account.py:727
 | 
			
		||||
#: ema/views.py:558 intervention/views.py:688
 | 
			
		||||
#: compensation/views/compensation.py:613 compensation/views/eco_account.py:728
 | 
			
		||||
#: ema/views.py:559 intervention/views.py:688
 | 
			
		||||
msgid "Report {}"
 | 
			
		||||
msgstr "Bericht {}"
 | 
			
		||||
 | 
			
		||||
@ -1246,36 +1250,36 @@ msgstr "Ökokonto {} hinzugefügt"
 | 
			
		||||
msgid "Eco-Account {} edited"
 | 
			
		||||
msgstr "Ökokonto {} bearbeitet"
 | 
			
		||||
 | 
			
		||||
#: compensation/views/eco_account.py:276
 | 
			
		||||
#: compensation/views/eco_account.py:277
 | 
			
		||||
msgid "Eco-account removed"
 | 
			
		||||
msgstr "Ökokonto entfernt"
 | 
			
		||||
 | 
			
		||||
#: compensation/views/eco_account.py:380 ema/views.py:282
 | 
			
		||||
#: compensation/views/eco_account.py:381 ema/views.py:283
 | 
			
		||||
#: intervention/views.py:641
 | 
			
		||||
msgid "{} unrecorded"
 | 
			
		||||
msgstr "{} entzeichnet"
 | 
			
		||||
 | 
			
		||||
#: compensation/views/eco_account.py:380 ema/views.py:282
 | 
			
		||||
#: compensation/views/eco_account.py:381 ema/views.py:283
 | 
			
		||||
#: intervention/views.py:641
 | 
			
		||||
msgid "{} recorded"
 | 
			
		||||
msgstr "{} verzeichnet"
 | 
			
		||||
 | 
			
		||||
#: compensation/views/eco_account.py:804 ema/views.py:628
 | 
			
		||||
#: compensation/views/eco_account.py:805 ema/views.py:629
 | 
			
		||||
#: intervention/views.py:439
 | 
			
		||||
msgid "{} has already been shared with you"
 | 
			
		||||
msgstr "{} wurde bereits für Sie freigegeben"
 | 
			
		||||
 | 
			
		||||
#: compensation/views/eco_account.py:809 ema/views.py:633
 | 
			
		||||
#: compensation/views/eco_account.py:810 ema/views.py:634
 | 
			
		||||
#: intervention/views.py:444
 | 
			
		||||
msgid "{} has been shared with you"
 | 
			
		||||
msgstr "{} ist nun für Sie freigegeben"
 | 
			
		||||
 | 
			
		||||
#: compensation/views/eco_account.py:816 ema/views.py:640
 | 
			
		||||
#: compensation/views/eco_account.py:817 ema/views.py:641
 | 
			
		||||
#: intervention/views.py:451
 | 
			
		||||
msgid "Share link invalid"
 | 
			
		||||
msgstr "Freigabelink ungültig"
 | 
			
		||||
 | 
			
		||||
#: compensation/views/eco_account.py:839 ema/views.py:663
 | 
			
		||||
#: compensation/views/eco_account.py:840 ema/views.py:664
 | 
			
		||||
#: intervention/views.py:474
 | 
			
		||||
msgid "Share settings updated"
 | 
			
		||||
msgstr "Freigabe Einstellungen aktualisiert"
 | 
			
		||||
@ -1316,11 +1320,11 @@ msgstr "EMAs - Übersicht"
 | 
			
		||||
msgid "EMA {} added"
 | 
			
		||||
msgstr "EMA {} hinzugefügt"
 | 
			
		||||
 | 
			
		||||
#: ema/views.py:230
 | 
			
		||||
#: ema/views.py:231
 | 
			
		||||
msgid "EMA {} edited"
 | 
			
		||||
msgstr "EMA {} bearbeitet"
 | 
			
		||||
 | 
			
		||||
#: ema/views.py:263
 | 
			
		||||
#: ema/views.py:264
 | 
			
		||||
msgid "EMA removed"
 | 
			
		||||
msgstr "EMA entfernt"
 | 
			
		||||
 | 
			
		||||
@ -1799,6 +1803,10 @@ msgstr "Wenn meine freigegebenen Daten gelöscht wurden"
 | 
			
		||||
msgid "On shared data checked"
 | 
			
		||||
msgstr "Wenn meine freigegebenen Daten geprüft wurden"
 | 
			
		||||
 | 
			
		||||
#: konova/management/commands/setup_data.py:31
 | 
			
		||||
msgid "On deduction changes"
 | 
			
		||||
msgstr "Wenn eine Abbuchung zu meinem Ökokonto verändert wird"
 | 
			
		||||
 | 
			
		||||
#: konova/models/deadline.py:18
 | 
			
		||||
msgid "Finished"
 | 
			
		||||
msgstr "Umgesetzt bis"
 | 
			
		||||
@ -1909,23 +1917,27 @@ msgstr "{} - Zugriff entzogen"
 | 
			
		||||
msgid "{} - Shared access given"
 | 
			
		||||
msgstr "{} - Zugriff freigegeben"
 | 
			
		||||
 | 
			
		||||
#: konova/utils/mailer.py:160 konova/utils/mailer.py:275
 | 
			
		||||
#: konova/utils/mailer.py:160 konova/utils/mailer.py:302
 | 
			
		||||
msgid "{} - Shared data unrecorded"
 | 
			
		||||
msgstr "{} - Freigegebene Daten entzeichnet"
 | 
			
		||||
 | 
			
		||||
#: konova/utils/mailer.py:183 konova/utils/mailer.py:252
 | 
			
		||||
#: konova/utils/mailer.py:183 konova/utils/mailer.py:279
 | 
			
		||||
msgid "{} - Shared data recorded"
 | 
			
		||||
msgstr "{} - Freigegebene Daten verzeichnet"
 | 
			
		||||
 | 
			
		||||
#: konova/utils/mailer.py:206 konova/utils/mailer.py:321
 | 
			
		||||
#: konova/utils/mailer.py:206 konova/utils/mailer.py:348
 | 
			
		||||
msgid "{} - Shared data checked"
 | 
			
		||||
msgstr "{} - Freigegebene Daten geprüft"
 | 
			
		||||
 | 
			
		||||
#: konova/utils/mailer.py:229 konova/utils/mailer.py:298
 | 
			
		||||
#: konova/utils/mailer.py:233 konova/utils/mailer.py:372
 | 
			
		||||
msgid "{} - Deduction changed"
 | 
			
		||||
msgstr "{} - Abbuchung geändert"
 | 
			
		||||
 | 
			
		||||
#: konova/utils/mailer.py:256 konova/utils/mailer.py:325
 | 
			
		||||
msgid "{} - Shared data deleted"
 | 
			
		||||
msgstr "{} - Freigegebene Daten gelöscht"
 | 
			
		||||
 | 
			
		||||
#: konova/utils/mailer.py:342 templates/email/api/verify_token.html:4
 | 
			
		||||
#: konova/utils/mailer.py:393 templates/email/api/verify_token.html:4
 | 
			
		||||
msgid "Request for new API token"
 | 
			
		||||
msgstr "Anfrage für neuen API Token"
 | 
			
		||||
 | 
			
		||||
@ -2229,6 +2241,7 @@ msgstr ""
 | 
			
		||||
#: templates/email/checking/shared_data_checked_team.html:19
 | 
			
		||||
#: templates/email/deleting/shared_data_deleted.html:19
 | 
			
		||||
#: templates/email/deleting/shared_data_deleted_team.html:19
 | 
			
		||||
#: templates/email/other/deduction_changed.html:38
 | 
			
		||||
#: templates/email/recording/shared_data_recorded.html:19
 | 
			
		||||
#: templates/email/recording/shared_data_recorded_team.html:19
 | 
			
		||||
#: templates/email/recording/shared_data_unrecorded.html:19
 | 
			
		||||
@ -2247,6 +2260,7 @@ msgstr "Freigegebene Daten geprüft"
 | 
			
		||||
 | 
			
		||||
#: templates/email/checking/shared_data_checked.html:8
 | 
			
		||||
#: templates/email/deleting/shared_data_deleted.html:8
 | 
			
		||||
#: templates/email/other/deduction_changed.html:8
 | 
			
		||||
#: templates/email/recording/shared_data_recorded.html:8
 | 
			
		||||
#: templates/email/recording/shared_data_unrecorded.html:8
 | 
			
		||||
#: templates/email/sharing/shared_access_given.html:8
 | 
			
		||||
@ -2289,6 +2303,7 @@ msgstr "der folgende Datensatz wurde soeben gelöscht "
 | 
			
		||||
 | 
			
		||||
#: templates/email/deleting/shared_data_deleted.html:16
 | 
			
		||||
#: templates/email/deleting/shared_data_deleted_team.html:16
 | 
			
		||||
#: templates/email/other/deduction_changed.html:35
 | 
			
		||||
msgid ""
 | 
			
		||||
"If this should not have been happened, please contact us. See the signature "
 | 
			
		||||
"for details."
 | 
			
		||||
@ -2296,6 +2311,31 @@ msgstr ""
 | 
			
		||||
"Falls das nicht hätte passieren dürfen, kontaktieren Sie uns bitte. In der E-"
 | 
			
		||||
"mail Signatur finden Sie weitere Kontaktinformationen."
 | 
			
		||||
 | 
			
		||||
#: templates/email/other/deduction_changed.html:4
 | 
			
		||||
msgid "Deduction changed"
 | 
			
		||||
msgstr "Abbuchung geändert"
 | 
			
		||||
 | 
			
		||||
#: templates/email/other/deduction_changed.html:10
 | 
			
		||||
msgid "a deduction of this eco account has changed:"
 | 
			
		||||
msgstr "eine Abbuchung des Ökokontos hat sich geändert:"
 | 
			
		||||
 | 
			
		||||
#: templates/email/other/deduction_changed.html:14
 | 
			
		||||
msgid "Attribute"
 | 
			
		||||
msgstr "Attribute"
 | 
			
		||||
 | 
			
		||||
#: templates/email/other/deduction_changed.html:15
 | 
			
		||||
msgid "Old"
 | 
			
		||||
msgstr "Alt"
 | 
			
		||||
 | 
			
		||||
#: templates/email/other/deduction_changed.html:16
 | 
			
		||||
#: templates/generic_index.html:43 user/templates/user/team/index.html:22
 | 
			
		||||
msgid "New"
 | 
			
		||||
msgstr "Neu"
 | 
			
		||||
 | 
			
		||||
#: templates/email/other/deduction_changed.html:19
 | 
			
		||||
msgid "EcoAccount"
 | 
			
		||||
msgstr "Ökokonto"
 | 
			
		||||
 | 
			
		||||
#: templates/email/recording/shared_data_recorded.html:4
 | 
			
		||||
#: templates/email/recording/shared_data_recorded_team.html:4
 | 
			
		||||
msgid "Shared data recorded"
 | 
			
		||||
@ -2493,10 +2533,6 @@ msgstr "* sind Pflichtfelder."
 | 
			
		||||
msgid "New entry"
 | 
			
		||||
msgstr "Neuer Eintrag"
 | 
			
		||||
 | 
			
		||||
#: templates/generic_index.html:43 user/templates/user/team/index.html:22
 | 
			
		||||
msgid "New"
 | 
			
		||||
msgstr "Neu"
 | 
			
		||||
 | 
			
		||||
#: templates/generic_index.html:58
 | 
			
		||||
msgid "Search for keywords"
 | 
			
		||||
msgstr "Nach Schlagwörtern suchen"
 | 
			
		||||
 | 
			
		||||
@ -6,6 +6,7 @@
 | 
			
		||||
    <article>
 | 
			
		||||
        {% trans 'Hello support' %},
 | 
			
		||||
        <br>
 | 
			
		||||
        <br>
 | 
			
		||||
        {% trans 'you need to verify the API token for user' %}:
 | 
			
		||||
        <br>
 | 
			
		||||
        <br>
 | 
			
		||||
 | 
			
		||||
@ -7,6 +7,7 @@
 | 
			
		||||
    <article>
 | 
			
		||||
        {% trans 'Hello ' %} {{user.username}},
 | 
			
		||||
        <br>
 | 
			
		||||
        <br>
 | 
			
		||||
        {% trans 'the following dataset has just been checked' %}
 | 
			
		||||
        <br>
 | 
			
		||||
        <strong>{{obj_identifier}}</strong>
 | 
			
		||||
 | 
			
		||||
@ -7,6 +7,7 @@
 | 
			
		||||
    <article>
 | 
			
		||||
        {% trans 'Hello team' %} {{team.name}},
 | 
			
		||||
        <br>
 | 
			
		||||
        <br>
 | 
			
		||||
        {% trans 'the following dataset has just been checked' %}
 | 
			
		||||
        <br>
 | 
			
		||||
        <strong>{{obj_identifier}}</strong>
 | 
			
		||||
 | 
			
		||||
@ -7,6 +7,7 @@
 | 
			
		||||
    <article>
 | 
			
		||||
        {% trans 'Hello ' %} {{user.username}},
 | 
			
		||||
        <br>
 | 
			
		||||
        <br>
 | 
			
		||||
        {% trans 'the following dataset has just been deleted' %}
 | 
			
		||||
        <br>
 | 
			
		||||
        <strong>{{obj_identifier}}</strong>
 | 
			
		||||
 | 
			
		||||
@ -7,6 +7,7 @@
 | 
			
		||||
    <article>
 | 
			
		||||
        {% trans 'Hello team' %} {{team.name}},
 | 
			
		||||
        <br>
 | 
			
		||||
        <br>
 | 
			
		||||
        {% trans 'the following dataset has just been deleted' %}
 | 
			
		||||
        <br>
 | 
			
		||||
        <strong>{{obj_identifier}}</strong>
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										50
									
								
								templates/email/other/deduction_changed.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								templates/email/other/deduction_changed.html
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,50 @@
 | 
			
		||||
{% load i18n %}
 | 
			
		||||
 | 
			
		||||
<div>
 | 
			
		||||
    <h2>{% translate 'Deduction changed' %}</h2>
 | 
			
		||||
    <h4>{{obj_identifier}}</h4>
 | 
			
		||||
    <hr>
 | 
			
		||||
    <article>
 | 
			
		||||
        {% translate 'Hello ' %} {{user.username}},
 | 
			
		||||
        <br>
 | 
			
		||||
        <br>
 | 
			
		||||
        {% translate 'a deduction of this eco account has changed:' %}
 | 
			
		||||
        <br>
 | 
			
		||||
        <br>
 | 
			
		||||
        <table>
 | 
			
		||||
            <tr>
 | 
			
		||||
               <th scope="col">{% translate 'Attribute' %}</th>
 | 
			
		||||
               <th scope="col">{% translate 'Old' %}</th>
 | 
			
		||||
               <th scope="col">{% translate 'New' %}</th>
 | 
			
		||||
            </tr>
 | 
			
		||||
            <tr>
 | 
			
		||||
                <td>{% translate 'EcoAccount' %}</td>
 | 
			
		||||
                <td>{{data_changes.account.old}}</td>
 | 
			
		||||
                <td>{{data_changes.account.new}}</td>
 | 
			
		||||
            </tr>
 | 
			
		||||
            <tr>
 | 
			
		||||
                <td>{% translate 'Intervention' %}</td>
 | 
			
		||||
                <td>{{data_changes.intervention.old}}</td>
 | 
			
		||||
                <td>{{data_changes.intervention.new}}</td>
 | 
			
		||||
            </tr>
 | 
			
		||||
            <tr>
 | 
			
		||||
                <td>{% translate 'Surface' %}</td>
 | 
			
		||||
                <td>{{data_changes.surface.old}} m²</td>
 | 
			
		||||
                <td>{{data_changes.surface.new}} m²</td>
 | 
			
		||||
            </tr>
 | 
			
		||||
        </table>
 | 
			
		||||
        <br>
 | 
			
		||||
        <br>
 | 
			
		||||
        {% translate 'If this should not have been happened, please contact us. See the signature for details.' %}
 | 
			
		||||
        <br>
 | 
			
		||||
        <br>
 | 
			
		||||
        {% translate 'Best regards' %}
 | 
			
		||||
        <br>
 | 
			
		||||
        KSP
 | 
			
		||||
        <br>
 | 
			
		||||
        <br>
 | 
			
		||||
        <br>
 | 
			
		||||
        {% include 'email/signature.html' %}
 | 
			
		||||
    </article>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										50
									
								
								templates/email/other/deduction_changed_team.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								templates/email/other/deduction_changed_team.html
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,50 @@
 | 
			
		||||
{% load i18n %}
 | 
			
		||||
 | 
			
		||||
<div>
 | 
			
		||||
    <h2>{% translate 'Deduction changed' %}</h2>
 | 
			
		||||
    <h4>{{obj_identifier}}</h4>
 | 
			
		||||
    <hr>
 | 
			
		||||
    <article>
 | 
			
		||||
        {% trans 'Hello team' %} {{team.name}},
 | 
			
		||||
        <br>
 | 
			
		||||
        <br>
 | 
			
		||||
        {% translate 'a deduction of this eco account has changed:' %}
 | 
			
		||||
        <br>
 | 
			
		||||
        <br>
 | 
			
		||||
        <table>
 | 
			
		||||
            <tr>
 | 
			
		||||
               <th scope="col">{% translate 'Attribute' %}</th>
 | 
			
		||||
               <th scope="col">{% translate 'Old' %}</th>
 | 
			
		||||
               <th scope="col">{% translate 'New' %}</th>
 | 
			
		||||
            </tr>
 | 
			
		||||
            <tr>
 | 
			
		||||
                <td>{% translate 'EcoAccount' %}</td>
 | 
			
		||||
                <td>{{data_changes.account.old}}</td>
 | 
			
		||||
                <td>{{data_changes.account.new}}</td>
 | 
			
		||||
            </tr>
 | 
			
		||||
            <tr>
 | 
			
		||||
                <td>{% translate 'Intervention' %}</td>
 | 
			
		||||
                <td>{{data_changes.intervention.old}}</td>
 | 
			
		||||
                <td>{{data_changes.intervention.new}}</td>
 | 
			
		||||
            </tr>
 | 
			
		||||
            <tr>
 | 
			
		||||
                <td>{% translate 'Surface' %}</td>
 | 
			
		||||
                <td>{{data_changes.surface.old}} m²</td>
 | 
			
		||||
                <td>{{data_changes.surface.new}} m²</td>
 | 
			
		||||
            </tr>
 | 
			
		||||
        </table>
 | 
			
		||||
        <br>
 | 
			
		||||
        <br>
 | 
			
		||||
        {% translate 'If this should not have been happened, please contact us. See the signature for details.' %}
 | 
			
		||||
        <br>
 | 
			
		||||
        <br>
 | 
			
		||||
        {% translate 'Best regards' %}
 | 
			
		||||
        <br>
 | 
			
		||||
        KSP
 | 
			
		||||
        <br>
 | 
			
		||||
        <br>
 | 
			
		||||
        <br>
 | 
			
		||||
        {% include 'email/signature.html' %}
 | 
			
		||||
    </article>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
@ -7,6 +7,7 @@
 | 
			
		||||
    <article>
 | 
			
		||||
        {% trans 'Hello ' %} {{user.username}},
 | 
			
		||||
        <br>
 | 
			
		||||
        <br>
 | 
			
		||||
        {% trans 'the following dataset has just been recorded' %}
 | 
			
		||||
        <br>
 | 
			
		||||
        <strong>{{obj_identifier}}</strong>
 | 
			
		||||
 | 
			
		||||
@ -7,6 +7,7 @@
 | 
			
		||||
    <article>
 | 
			
		||||
        {% trans 'Hello team' %} {{team.name}},
 | 
			
		||||
        <br>
 | 
			
		||||
        <br>
 | 
			
		||||
        {% trans 'the following dataset has just been recorded' %}
 | 
			
		||||
        <br>
 | 
			
		||||
        <strong>{{obj_identifier}}</strong>
 | 
			
		||||
 | 
			
		||||
@ -7,6 +7,7 @@
 | 
			
		||||
    <article>
 | 
			
		||||
        {% trans 'Hello ' %} {{user.username}},
 | 
			
		||||
        <br>
 | 
			
		||||
        <br>
 | 
			
		||||
        {% trans 'the following dataset has just been unrecorded' %}
 | 
			
		||||
        <br>
 | 
			
		||||
        <strong>{{obj_identifier}}</strong>
 | 
			
		||||
 | 
			
		||||
@ -7,6 +7,7 @@
 | 
			
		||||
    <article>
 | 
			
		||||
        {% trans 'Hello team' %} {{team.name}},
 | 
			
		||||
        <br>
 | 
			
		||||
        <br>
 | 
			
		||||
        {% trans 'the following dataset has just been unrecorded' %}
 | 
			
		||||
        <br>
 | 
			
		||||
        <strong>{{obj_identifier}}</strong>
 | 
			
		||||
 | 
			
		||||
@ -7,6 +7,7 @@
 | 
			
		||||
    <article>
 | 
			
		||||
        {% trans 'Hello ' %} {{user.username}},
 | 
			
		||||
        <br>
 | 
			
		||||
        <br>
 | 
			
		||||
        {% trans 'the following dataset has just been shared with you' %}
 | 
			
		||||
        <br>
 | 
			
		||||
        <strong>{{obj_identifier}}</strong>
 | 
			
		||||
 | 
			
		||||
@ -7,6 +7,7 @@
 | 
			
		||||
    <article>
 | 
			
		||||
        {% trans 'Hello team' %} {{team.name}},
 | 
			
		||||
        <br>
 | 
			
		||||
        <br>
 | 
			
		||||
        {% trans 'the following dataset has just been shared with your team' %}
 | 
			
		||||
        <br>
 | 
			
		||||
        <strong>{{obj_identifier}}</strong>
 | 
			
		||||
 | 
			
		||||
@ -7,6 +7,7 @@
 | 
			
		||||
    <article>
 | 
			
		||||
        {% trans 'Hello ' %} {{user.username}},
 | 
			
		||||
        <br>
 | 
			
		||||
        <br>
 | 
			
		||||
        {% trans 'your shared access, including editing, has been revoked for the dataset ' %}
 | 
			
		||||
        <br>
 | 
			
		||||
        <strong>{{obj_identifier}}</strong>
 | 
			
		||||
 | 
			
		||||
@ -7,6 +7,7 @@
 | 
			
		||||
    <article>
 | 
			
		||||
        {% trans 'Hello team' %} {{team.name}},
 | 
			
		||||
        <br>
 | 
			
		||||
        <br>
 | 
			
		||||
        {% trans 'your teams shared access, including editing, has been revoked for the dataset ' %}
 | 
			
		||||
        <br>
 | 
			
		||||
        <strong>{{obj_identifier}}</strong>
 | 
			
		||||
 | 
			
		||||
@ -13,4 +13,5 @@ class UserNotificationEnum(BaseEnum):
 | 
			
		||||
    NOTIFY_ON_SHARED_DATA_RECORDED = "NOTIFY_ON_SHARED_DATA_RECORDED"  # notifies in case data has been "verzeichnet"
 | 
			
		||||
    NOTIFY_ON_SHARED_DATA_DELETED = "NOTIFY_ON_SHARED_DATA_DELETED"  # notifies in case data has been deleted
 | 
			
		||||
    NOTIFY_ON_SHARED_DATA_CHECKED = "NOTIFY_ON_SHARED_DATA_CHECKED"  # notifies in case shared data has been checked
 | 
			
		||||
    NOTIFY_ON_SHARED_ACCESS_GAINED = "NOTIFY_ON_SHARED_ACCESS_GAINED"  # notifies in case new access has been gained
 | 
			
		||||
    NOTIFY_ON_SHARED_ACCESS_GAINED = "NOTIFY_ON_SHARED_ACCESS_GAINED"  # notifies in case new access has been gained
 | 
			
		||||
    NOTIFY_ON_DEDUCTION_CHANGES = "NOTIFY_ON_DEDUCTION_CHANGES"  # notifies in case any changes (edit|remove) have been performed on a deduction of the user's ecoaccounts
 | 
			
		||||
@ -7,7 +7,7 @@ Created on: 08.07.21
 | 
			
		||||
"""
 | 
			
		||||
from dal import autocomplete
 | 
			
		||||
from django import forms
 | 
			
		||||
from django.db import IntegrityError, transaction
 | 
			
		||||
from django.db import transaction
 | 
			
		||||
from django.urls import reverse, reverse_lazy
 | 
			
		||||
from django.utils.translation import gettext_lazy as _
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -95,6 +95,20 @@ class Team(UuidModel, DeletableObjectMixin):
 | 
			
		||||
        mailer = Mailer()
 | 
			
		||||
        mailer.send_mail_shared_data_checked_team(obj_identifier, obj_title, self)
 | 
			
		||||
 | 
			
		||||
    def send_mail_deduction_changed(self, obj_identifier, obj_title, data_changes):
 | 
			
		||||
        """ Sends a mail to the team members in case of changed deduction values
 | 
			
		||||
 | 
			
		||||
        Args:
 | 
			
		||||
            obj_identifier (str): Identifier of the main object
 | 
			
		||||
            obj_title (str): Title of the main object
 | 
			
		||||
            data_changes (dict): Contains the old|new changes of the deduction changes
 | 
			
		||||
 | 
			
		||||
        Returns:
 | 
			
		||||
 | 
			
		||||
        """
 | 
			
		||||
        mailer = Mailer()
 | 
			
		||||
        mailer.send_mail_deduction_changed_team(obj_identifier, obj_title, self, data_changes)
 | 
			
		||||
 | 
			
		||||
    def send_mail_shared_data_deleted(self, obj_identifier, obj_title):
 | 
			
		||||
        """ Sends a mail to the team members in case of deleted data
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -145,6 +145,22 @@ class User(AbstractUser):
 | 
			
		||||
            mailer = Mailer()
 | 
			
		||||
            mailer.send_mail_shared_data_checked(obj_identifier, obj_title, self)
 | 
			
		||||
 | 
			
		||||
    def send_mail_deduction_changed(self, obj_identifier, obj_title, data_changes):
 | 
			
		||||
        """ Sends a mail to the user in case of a changed deduction
 | 
			
		||||
 | 
			
		||||
        Args:
 | 
			
		||||
            obj_identifier (str): Identifier of the main object
 | 
			
		||||
            obj_title (str): Title of the main object
 | 
			
		||||
            data_changes (dict): Contains the old|new changes of the deduction changes
 | 
			
		||||
 | 
			
		||||
        Returns:
 | 
			
		||||
 | 
			
		||||
        """
 | 
			
		||||
        notification_set = self.is_notification_setting_set(UserNotificationEnum.NOTIFY_ON_DEDUCTION_CHANGES)
 | 
			
		||||
        if notification_set:
 | 
			
		||||
            mailer = Mailer()
 | 
			
		||||
            mailer.send_mail_deduction_changed(obj_identifier, obj_title, self, data_changes)
 | 
			
		||||
 | 
			
		||||
    def get_API_token(self):
 | 
			
		||||
        """ Getter for an API token
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user