Commit f59b384d authored by Jacek Lebioda's avatar Jacek Lebioda
Browse files

feat: corrections in template and send email functions

parent d1e82780
......@@ -46,7 +46,7 @@
Projects count: {{ projects | length }} <br />
Datasets count: {{ datasets | length }} <br />
Data declarations count: {{ data_declarations | length }} <br /><br />
Issues found: {{ issues | length }}
{% if issues %}Issues found: {{ issues | length }}{% else %}No issues with the entries found{% endif %}
</td>
<td width="5%" style="background-color: #fff"></td>
</tr>
......@@ -108,7 +108,7 @@
</table>
{% endfor %}
{% if issues %}
<table border="0" cellspacing="0" cellpadding="0"
style="table-layout: fixed;font-family: 'Roboto','Helvetica','Arial',sans-serif;
font-weight: 300; background-color: rgba(158, 158, 158, 0.2);"
......@@ -142,5 +142,5 @@
</tr>
{% endfor %}
<tr style="background-color: #ffffff; height: 60px; width: 100%"><td colspan=4></td></tr>
</table>
</table>{% endif %}
</div>
......@@ -9,7 +9,7 @@ General overview:
Projects count: {{ projects | length }}
Datasets count: {{ datasets | length }}
Data declarations count: {{ data_declarations | length }}
Issues found: {{ issues | length }}
{% if issues %}Issues found: {{ issues | length }}{% else %}No issues with the entries found{% endif %}
Detailed overview:
{% for project in projects.all %}
......@@ -24,10 +24,10 @@ Detailed overview:
{% endfor %}
Issues found:
{% if issues %}Issues found:
{% for issue in issues %}
{{ issue.code }}: {{ issue.description }}
{{ issue.object_title }}
{{ issue.url }}
{% endfor %}
{% endfor %}{% endif %}
\ No newline at end of file
import datetime
from collections import defaultdict
from datetime import timedelta
from celery import shared_task
from django.conf import settings
from django.utils import timezone
from django.db.models import Q
from django.utils import timezone
from core.models import Contract, DataDeclaration, Dataset, Document, Project, User
from notification.email_sender import send_the_email
from notification.email_sender import send_email_from_template
from notification.models import (Notification, NotificationStyle, NotificationVerb)
# map each notification style to a delta
......@@ -44,7 +46,7 @@ def send_notifications_for_user_by_time(user_id, time):
'user': user,
'notifications': dict(notifications_by_verb)
}
send_the_email(
send_email_from_template(
settings.EMAIL_DONOTREPLY,
user.email,
'Notifications',
......@@ -65,7 +67,7 @@ def send_dataset_notification_for_user(user_id, dataset_id, created):
'dataset': dataset,
'created': created
}
send_the_email(
send_email_from_template(
settings.EMAIL_DONOTREPLY,
user.email,
'Notifications',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment