# 63 Mail shared access revoked

* adds mail support for revoking shared access
* adds/updates translations
This commit is contained in:
mpeltriaux 2022-01-12 14:17:12 +01:00
parent 02970b19b4
commit 9c4bab3800
6 changed files with 109 additions and 27 deletions

View File

@ -204,9 +204,15 @@ DEBUG_TOOLBAR_CONFIG = {
}
# EMAIL (see https://docs.djangoproject.com/en/dev/topics/email/)
DEFAULT_FROM_EMAIL = "bot@arneo.de" # The default email address for the 'from' element
# CHANGE_ME !!! ONLY FOR DEVELOPMENT !!!
EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend'
EMAIL_FILE_PATH = '/tmp/app-messages' # change this to a proper location
DEFAULT_FROM_EMAIL = "service@ksp.de" # The default email address for the 'from' element
EMAIL_HOST = "localhost"
EMAIL_PORT = "1025"
EMAIL_REPLY_TO = "ksp-servicestelle@sgdnord.rlp.de"
EMAIL_PORT = "25"
#EMAIL_HOST_USER = ""
#EMAIL_HOST_PASSWORD = ""
EMAIL_USE_TLS = False

View File

@ -11,7 +11,7 @@ from django.core.mail import send_mail
from django.template.loader import render_to_string
from django.utils.translation import gettext_lazy as _
from konova.sub_settings.django_settings import DEFAULT_FROM_EMAIL
from konova.sub_settings.django_settings import DEFAULT_FROM_EMAIL, EMAIL_REPLY_TO
logger = logging.getLogger(__name__)
@ -40,7 +40,8 @@ class Mailer:
"""
return send_mail(
subject=subject,
message=msg,
message=None,
html_message=msg,
from_email=self.from_mail,
recipient_list=recipient_list,
fail_silently=self.fail_silently,
@ -60,6 +61,7 @@ class Mailer:
context = {
"user": user,
"obj": obj,
"EMAIL_REPLY_TO": EMAIL_REPLY_TO,
}
msg = render_to_string("email/sharing/shared_access_removed.html", context)
user_mail_address = [user.email]

Binary file not shown.

View File

@ -26,7 +26,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-01-12 11:33+0100\n"
"POT-Creation-Date: 2022-01-12 14:12+0100\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"
@ -47,7 +47,7 @@ msgstr "Bis"
#: analysis/forms.py:47 compensation/forms/forms.py:77
#: compensation/templates/compensation/detail/eco_account/view.html:58
#: compensation/templates/compensation/report/eco_account/report.html:16
#: compensation/utils/quality.py:112 ema/templates/ema/detail/view.html:49
#: compensation/utils/quality.py:100 ema/templates/ema/detail/view.html:49
#: ema/templates/ema/report/report.html:16 ema/utils/quality.py:26
#: intervention/forms/forms.py:100
#: intervention/templates/intervention/detail/view.html:56
@ -140,7 +140,7 @@ msgstr "Zuständigkeitsbereich"
#: compensation/templates/compensation/detail/compensation/view.html:63
#: intervention/tables.py:33
#: intervention/templates/intervention/detail/view.html:68
#: user/models/user_action.py:19
#: user/models/user_action.py:18
msgid "Checked"
msgstr "Geprüft"
@ -159,7 +159,7 @@ msgstr "Geprüft"
#: ema/tables.py:38 ema/templates/ema/detail/view.html:35
#: intervention/tables.py:39
#: intervention/templates/intervention/detail/view.html:82
#: user/models/user_action.py:20
#: user/models/user_action.py:19
msgid "Recorded"
msgstr "Verzeichnet"
@ -374,7 +374,7 @@ msgstr "Zusätzlicher Kommentar"
#: compensation/forms/forms.py:93
#: compensation/templates/compensation/detail/eco_account/view.html:62
#: compensation/templates/compensation/report/eco_account/report.html:20
#: compensation/utils/quality.py:114 ema/templates/ema/detail/view.html:53
#: compensation/utils/quality.py:102 ema/templates/ema/detail/view.html:53
#: ema/templates/ema/report/report.html:20 ema/utils/quality.py:28
#: intervention/forms/forms.py:128
#: intervention/templates/intervention/detail/view.html:60
@ -434,7 +434,7 @@ msgstr "Neue Kompensation"
msgid "Edit compensation"
msgstr "Bearbeite Kompensation"
#: compensation/forms/forms.py:302 compensation/utils/quality.py:96
#: compensation/forms/forms.py:302 compensation/utils/quality.py:84
msgid "Available Surface"
msgstr "Verfügbare Fläche"
@ -444,7 +444,7 @@ msgstr "Die für Abbuchungen zur Verfügung stehende Menge"
#: compensation/forms/forms.py:314
#: compensation/templates/compensation/detail/eco_account/view.html:66
#: compensation/utils/quality.py:84
#: compensation/utils/quality.py:72
msgid "Agreement date"
msgstr "Vereinbarungsdatum"
@ -962,7 +962,7 @@ msgstr "Eingriffskennung"
#: compensation/templates/compensation/detail/eco_account/includes/deductions.html:37
#: intervention/templates/intervention/detail/includes/deductions.html:34
#: user/models/user_action.py:22
#: user/models/user_action.py:21
msgid "Created"
msgstr "Erstellt"
@ -1040,21 +1040,17 @@ msgstr "-"
msgid "States unequal"
msgstr "Ungleiche Zustandsflächenmengen"
#: compensation/utils/quality.py:72
msgid "Not recorded"
msgstr "Noch nicht verzeichnet"
#: compensation/utils/quality.py:86 intervention/utils/quality.py:84
#: compensation/utils/quality.py:74 intervention/utils/quality.py:84
msgid "Legal data"
msgstr "Rechtliche Daten"
#: compensation/utils/quality.py:100
#: compensation/utils/quality.py:88
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:116 ema/utils/quality.py:30
#: compensation/utils/quality.py:104 ema/utils/quality.py:30
#: intervention/utils/quality.py:55
msgid "Responsible data"
msgstr "Daten zu den verantwortlichen Stellen"
@ -1757,6 +1753,10 @@ msgstr "In Zwischenablage kopiert"
msgid "Document '{}' deleted"
msgstr "Dokument '{}' gelöscht"
#: konova/utils/mailer.py:70
msgid "{} - Shared access removed"
msgstr "{} - Zugriff entzogen"
#: konova/utils/message_templates.py:11
msgid "There was an error on this form."
msgstr "Es gab einen Fehler im Formular."
@ -1871,6 +1871,40 @@ msgstr "Alle"
msgid "News"
msgstr "Neuigkeiten"
#: templates/email/sharing/shared_access_removed.html:2
msgid "Shared access removed"
msgstr "Freigegebener Zugriff entzogen"
#: templates/email/sharing/shared_access_removed.html:6
msgid "Hello "
msgstr "Hallo "
#: templates/email/sharing/shared_access_removed.html:8
msgid ""
"your shared access, including editing, has been revoked for the dataset "
msgstr ""
"Ihnen wurde soeben der bearbeitende Zugriff auf den folgenden Datensatz entzogen: "
#: templates/email/sharing/shared_access_removed.html:13
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:14
msgid "Please use the provided search filter on the dataset`s overview pages to find them."
msgstr "Nutzen Sie hierzu einfach die entsprechenden Suchfilter auf den Übersichtsseiten"
#: templates/email/sharing/shared_access_removed.html:18
msgid "Best regards"
msgstr "Beste Grüße"
#: templates/email/signature.html:6
msgid "Please do not reply on this mail."
msgstr "Bitte antworten Sie nicht auf diese Mail."
#: templates/email/signature.html:8
msgid "If needed, please contact "
msgstr "Bei Rückfragen, wenden Sie sich bitte an "
#: templates/footer.html:6
msgid "Help"
msgstr "Hilfe"
@ -2026,31 +2060,31 @@ msgstr "Wann wollen Sie per E-Mail benachrichtigt werden?"
msgid "Edit notifications"
msgstr "Benachrichtigungen bearbeiten"
#: user/forms.py:76 user/templates/user/index.html:9
#: user/forms.py:72 user/templates/user/index.html:9
msgid "Username"
msgstr "Nutzername"
#: user/forms.py:87
#: user/forms.py:83
msgid "Person name"
msgstr "Name"
#: user/forms.py:98 user/templates/user/index.html:17
#: user/forms.py:94 user/templates/user/index.html:17
msgid "E-Mail"
msgstr ""
#: user/forms.py:112
#: user/forms.py:108
msgid "User contact data"
msgstr "Kontaktdaten"
#: user/models/user_action.py:21
#: user/models/user_action.py:20
msgid "Unrecorded"
msgstr "Entzeichnet"
#: user/models/user_action.py:23
#: user/models/user_action.py:22
msgid "Edited"
msgstr "Bearbeitet"
#: user/models/user_action.py:24
#: user/models/user_action.py:23
msgid "Deleted"
msgstr "Gelöscht"
@ -2095,7 +2129,7 @@ msgstr "Benachrichtigungseinstellungen ändern"
msgid "Notification settings"
msgstr "Benachrichtigungen"
#: user/views.py:56
#: user/views.py:52
msgid "Notifications edited"
msgstr "Benachrichtigungen bearbeitet"
@ -3602,6 +3636,9 @@ msgstr ""
msgid "Unable to connect to qpid with SASL mechanism %s"
msgstr ""
#~ msgid "Not recorded"
#~ msgstr "Noch nicht verzeichnet"
#~ msgid "On new related data"
#~ msgstr "Wenn neue Daten für mich angelegt werden"

View File

@ -0,0 +1,27 @@
{% load i18n %}
<div>
<h2>{% trans 'Shared access removed' %}</h2>
<h4>{{obj.identifier}}</h4>
<hr>
<article>
{% trans 'Hello ' %} {{user.username}},
<br>
{% trans 'your shared access, including editing, has been revoked for the dataset ' %}
<br>
<strong>'{{obj.identifier}}'</strong>
<br>
{% 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.' %}
<br>
<br>
{% trans 'Best regards' %}
<br>
KSP
<br>
<br>
<br>
{% include 'email/signature.html' %}
</article>
</div>

View File

@ -0,0 +1,10 @@
{% load i18n %}
<div>
<hr>
<small>
{% trans 'Please do not reply on this mail.' %}
<br>
{% trans 'If needed, please contact ' %} <a href="mailto:{{EMAIL_REPLY_TO}}">{{EMAIL_REPLY_TO}}</a>.
</small>
</div>