Skip to content
Snippets Groups Projects
Verified Commit e8129856 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Move email templates and preferences for data checks to core

parent 9838f025
No related branches found
No related tags found
1 merge request!92Resolve "Add task for checking plausibility of data"
Pipeline #4416 failed
...@@ -59,24 +59,3 @@ class AllowOpenPeriodsOnSameDay(BooleanPreference): ...@@ -59,24 +59,3 @@ class AllowOpenPeriodsOnSameDay(BooleanPreference):
help_text = _( help_text = _(
"Lessons in the past are not affected by this setting, you can open them whenever you want." "Lessons in the past are not affected by this setting, you can open them whenever you want."
) )
@site_preferences_registry.register
class DataChecksSendEmails(BooleanPreference):
"""Enable email sending if data checks detect problems."""
section = alsijil
name = "data_checks_send_emails"
default = False
verbose_name = _("Send emails if data checks detect problems")
@site_preferences_registry.register
class DataChecksEmailsRecipients(ModelMultipleChoicePreference):
"""Email recipients for data check problem emails."""
section = alsijil
name = "data_checks_recipients"
default = []
model = Person
verbose_name = _("Email recipients for data checks problem emails")
body {
line-height: 1.5;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
font-weight: normal;
color: rgba(0, 0, 0, 0.87);
}
.count {
text-align: right;
font-family: monospace;
font-size: 14pt;
}
td, th {
padding: 10px;
}
{% load i18n %}
{% block subject %}
{% trans "The system detected some new problems with your data." %}
{% endblock %}
{% block plain %}
{% trans "Hello," %}
{% blocktrans %}
the system detected some new problems with your data in the digital class register.
Please take some time to inspect them and solve the issues or mark them as ignored.
{% endblocktrans %}
{% for result in results %}
{{ result.0.problem_name }}: {{ result.1 }}
{% endfor %}
{% endblock %}
{% block html %}
<style>
{% include "templated_email/data_checks.css" %}
</style>
<p>{% trans "Hello," %}</p>
<p>
{% blocktrans %}
the system detected some new problems with your data in the digital class register.
Please take some time to inspect them and solve the issues or mark them as ignored.
{% endblocktrans %}
</p>
<table>
<tr>
<th>{% trans "Problem description" %}</th>
<th>{% trans "Count of objects with new problems" %}</th>
</tr>
{% for result in results %}
<tr>
<td>{{ result.0.problem_name }}</td>
<td class="count">{{ result.1 }}</td>
</tr>
{% endfor %}
</table>
{% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment