Merge pull request 'master' (#528) from master into Docker
Reviewed-on: #528
This commit was merged in pull request #528.
This commit is contained in:
BIN
konova/static/images/error_imgs/croc_technician_400_sm.png
Normal file
BIN
konova/static/images/error_imgs/croc_technician_400_sm.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 47 KiB |
BIN
konova/static/images/error_imgs/croc_technician_500_sm.png
Normal file
BIN
konova/static/images/error_imgs/croc_technician_500_sm.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 51 KiB |
@@ -5,7 +5,7 @@ Contact: michel.peltriaux@sgdnord.rlp.de
|
|||||||
Created on: 09.11.20
|
Created on: 09.11.20
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from django.core.mail import send_mail
|
from django.core.mail import send_mail, EmailMultiAlternatives
|
||||||
from django.template.loader import render_to_string
|
from django.template.loader import render_to_string
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
@@ -45,6 +45,19 @@ class Mailer:
|
|||||||
auth_password=self.auth_password
|
auth_password=self.auth_password
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def send_via_bcc(self, recipient_list: list, subject: str, msg: str):
|
||||||
|
"""
|
||||||
|
Sends a mail with subject and message where recipients will be masked via bcc
|
||||||
|
"""
|
||||||
|
email_obj = EmailMultiAlternatives(
|
||||||
|
subject,
|
||||||
|
msg,
|
||||||
|
self.from_mail,
|
||||||
|
bcc=recipient_list,
|
||||||
|
)
|
||||||
|
email_obj.attach_alternative(msg, "text/html")
|
||||||
|
return email_obj.send(fail_silently=self.fail_silently)
|
||||||
|
|
||||||
def send_mail_shared_access_removed(self, obj, user, municipals_names):
|
def send_mail_shared_access_removed(self, obj, user, municipals_names):
|
||||||
""" Send a mail if user has no access to the object anymore
|
""" Send a mail if user has no access to the object anymore
|
||||||
|
|
||||||
@@ -115,7 +128,7 @@ class Mailer:
|
|||||||
}
|
}
|
||||||
msg = render_to_string("email/sharing/shared_access_given_team.html", context)
|
msg = render_to_string("email/sharing/shared_access_given_team.html", context)
|
||||||
user_mail_address = users_to_notify.values_list("email", flat=True)
|
user_mail_address = users_to_notify.values_list("email", flat=True)
|
||||||
self.send(
|
self.send_via_bcc(
|
||||||
user_mail_address,
|
user_mail_address,
|
||||||
_("{} - Shared access given").format(obj.identifier),
|
_("{} - Shared access given").format(obj.identifier),
|
||||||
msg
|
msg
|
||||||
@@ -141,7 +154,7 @@ class Mailer:
|
|||||||
}
|
}
|
||||||
msg = render_to_string("email/sharing/shared_access_removed_team.html", context)
|
msg = render_to_string("email/sharing/shared_access_removed_team.html", context)
|
||||||
user_mail_address = users_to_notify.values_list("email", flat=True)
|
user_mail_address = users_to_notify.values_list("email", flat=True)
|
||||||
self.send(
|
self.send_via_bcc(
|
||||||
user_mail_address,
|
user_mail_address,
|
||||||
_("{} - Shared access removed").format(obj.identifier),
|
_("{} - Shared access removed").format(obj.identifier),
|
||||||
msg
|
msg
|
||||||
@@ -167,7 +180,7 @@ class Mailer:
|
|||||||
}
|
}
|
||||||
msg = render_to_string("email/recording/shared_data_unrecorded_team.html", context)
|
msg = render_to_string("email/recording/shared_data_unrecorded_team.html", context)
|
||||||
user_mail_address = users_to_notify.values_list("email", flat=True)
|
user_mail_address = users_to_notify.values_list("email", flat=True)
|
||||||
self.send(
|
self.send_via_bcc(
|
||||||
user_mail_address,
|
user_mail_address,
|
||||||
_("{} - Shared data unrecorded").format(obj.identifier),
|
_("{} - Shared data unrecorded").format(obj.identifier),
|
||||||
msg
|
msg
|
||||||
@@ -193,7 +206,7 @@ class Mailer:
|
|||||||
}
|
}
|
||||||
msg = render_to_string("email/recording/shared_data_recorded_team.html", context)
|
msg = render_to_string("email/recording/shared_data_recorded_team.html", context)
|
||||||
user_mail_address = users_to_notify.values_list("email", flat=True)
|
user_mail_address = users_to_notify.values_list("email", flat=True)
|
||||||
self.send(
|
self.send_via_bcc(
|
||||||
user_mail_address,
|
user_mail_address,
|
||||||
_("{} - Shared data recorded").format(obj.identifier),
|
_("{} - Shared data recorded").format(obj.identifier),
|
||||||
msg
|
msg
|
||||||
@@ -219,7 +232,7 @@ class Mailer:
|
|||||||
}
|
}
|
||||||
msg = render_to_string("email/checking/shared_data_checked_team.html", context)
|
msg = render_to_string("email/checking/shared_data_checked_team.html", context)
|
||||||
user_mail_address = users_to_notify.values_list("email", flat=True)
|
user_mail_address = users_to_notify.values_list("email", flat=True)
|
||||||
self.send(
|
self.send_via_bcc(
|
||||||
user_mail_address,
|
user_mail_address,
|
||||||
_("{} - Shared data checked").format(obj.identifier),
|
_("{} - Shared data checked").format(obj.identifier),
|
||||||
msg
|
msg
|
||||||
@@ -244,7 +257,7 @@ class Mailer:
|
|||||||
}
|
}
|
||||||
msg = render_to_string("email/other/deduction_changed_team.html", context)
|
msg = render_to_string("email/other/deduction_changed_team.html", context)
|
||||||
user_mail_address = users_to_notify.values_list("email", flat=True)
|
user_mail_address = users_to_notify.values_list("email", flat=True)
|
||||||
self.send(
|
self.send_via_bcc(
|
||||||
user_mail_address,
|
user_mail_address,
|
||||||
_("{} - Deduction changed").format(obj.identifier),
|
_("{} - Deduction changed").format(obj.identifier),
|
||||||
msg
|
msg
|
||||||
@@ -270,7 +283,7 @@ class Mailer:
|
|||||||
}
|
}
|
||||||
msg = render_to_string("email/deleting/shared_data_deleted_team.html", context)
|
msg = render_to_string("email/deleting/shared_data_deleted_team.html", context)
|
||||||
user_mail_address = users_to_notify.values_list("email", flat=True)
|
user_mail_address = users_to_notify.values_list("email", flat=True)
|
||||||
self.send(
|
self.send_via_bcc(
|
||||||
user_mail_address,
|
user_mail_address,
|
||||||
_("{} - Shared data deleted").format(obj.identifier),
|
_("{} - Shared data deleted").format(obj.identifier),
|
||||||
msg
|
msg
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<div class="jumbotron">
|
<div class="jumbotron">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
<img src="{% static 'images/error_imgs/croc_technician_400.png' %}" style="max-width: 150px">
|
<img src="{% static 'images/error_imgs/croc_technician_400_sm.png' %}" style="max-width: 150px">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-12 col-md-9 col-lg-9 col-xl-10">
|
<div class="col-sm-12 col-md-9 col-lg-9 col-xl-10">
|
||||||
<h1 class="display-4">{% fa5_icon 'question-circle' %}400</h1>
|
<h1 class="display-4">{% fa5_icon 'question-circle' %}400</h1>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<div class="jumbotron">
|
<div class="jumbotron">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
<img src="{% static 'images/error_imgs/croc_technician_500.png' %}" style="max-width: 150px">
|
<img src="{% static 'images/error_imgs/croc_technician_500_sm.png' %}" style="max-width: 150px">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-12 col-md-9 col-lg-9 col-xl-10">
|
<div class="col-sm-12 col-md-9 col-lg-9 col-xl-10">
|
||||||
<h1 class="display-4">{% fa5_icon 'fire-alt' %} 500</h1>
|
<h1 class="display-4">{% fa5_icon 'fire-alt' %} 500</h1>
|
||||||
|
|||||||
Reference in New Issue
Block a user