1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-02-12 19:01:18 +00:00

Compare commits

..

2 Commits

Author SHA1 Message Date
Yohann D'ANELLO
e05a1518d9
URLs in mails were missing domains
Signed-off-by: Yohann D'ANELLO <yohann.danello@animath.fr>
2020-12-21 17:42:38 +01:00
Yohann D'ANELLO
2319bdf91e
Rebuild search index each hour
Signed-off-by: Yohann D'ANELLO <yohann.danello@animath.fr>
2020-12-21 17:42:37 +01:00
4 changed files with 10 additions and 3 deletions

View File

@ -13,7 +13,9 @@ Bonjour {{ user.registration }},
L'équipe « {{ team.name }} » ({{ team.trigram }}) vient de demander à valider son équipe pour participer L'équipe « {{ team.name }} » ({{ team.trigram }}) vient de demander à valider son équipe pour participer
au {{ team.participation.get_problem_display }} des Correspondances des Jeunes Mathématicien·ne·s. au {{ team.participation.get_problem_display }} des Correspondances des Jeunes Mathématicien·ne·s.
Vous pouvez décider d'accepter ou de refuser l'équipe en vous rendant sur la page de l'équipe : Vous pouvez décider d'accepter ou de refuser l'équipe en vous rendant sur la page de l'équipe :
<a href="{% url "participation:team_detail" pk=team.pk %}">{% url "participation:team_detail" pk=team.pk %}</a> <a href="https://{{ domain }}{% url "participation:team_detail" pk=team.pk %}">
https://{{ domain }}{% url "participation:team_detail" pk=team.pk %}
</a>
</p> </p>
<p> <p>

View File

@ -3,7 +3,7 @@ Bonjour {{ user.registration }},
L'équipe « {{ team.name }} » ({{ team.trigram }}) vient de demander à valider son équipe pour participer L'équipe « {{ team.name }} » ({{ team.trigram }}) vient de demander à valider son équipe pour participer
au {{ team.participation.get_problem_display }} des Correspondances des Jeunes Mathématicien·ne·s. au {{ team.participation.get_problem_display }} des Correspondances des Jeunes Mathématicien·ne·s.
Vous pouvez décider d'accepter ou de refuser l'équipe en vous rendant sur la page de l'équipe : Vous pouvez décider d'accepter ou de refuser l'équipe en vous rendant sur la page de l'équipe :
{% url "participation:team_detail" pk=team.pk %} https://{{ domain }}{% url "participation:team_detail" pk=team.pk %}
Cordialement, Cordialement,

View File

@ -1,6 +1,8 @@
from io import BytesIO from io import BytesIO
from zipfile import ZipFile from zipfile import ZipFile
from django.contrib.sites.models import Site
from corres2math.lists import get_sympa_client from corres2math.lists import get_sympa_client
from corres2math.matrix import Matrix from corres2math.matrix import Matrix
from corres2math.views import AdminMixin from corres2math.views import AdminMixin
@ -208,7 +210,7 @@ class TeamDetailView(LoginRequiredMixin, FormMixin, ProcessFormView, DetailView)
self.object.participation.save() self.object.participation.save()
for admin in AdminRegistration.objects.all(): for admin in AdminRegistration.objects.all():
mail_context = dict(user=admin.user, team=self.object) mail_context = dict(user=admin.user, team=self.object, domain=Site.objects.first().domain)
mail_plain = render_to_string("participation/mails/request_validation.txt", mail_context) mail_plain = render_to_string("participation/mails/request_validation.txt", mail_context)
mail_html = render_to_string("participation/mails/request_validation.html", mail_context) mail_html = render_to_string("participation/mails/request_validation.html", mail_context)
admin.user.email_user("[Corres2math] Validation d'équipe", mail_plain, html_message=mail_html) admin.user.email_user("[Corres2math] Validation d'équipe", mail_plain, html_message=mail_html)

View File

@ -3,3 +3,6 @@
* * * * * cd /code && python manage.py send_mail -c 1 * * * * * cd /code && python manage.py send_mail -c 1
* * * * * cd /code && python manage.py retry_deferred -c 1 * * * * * cd /code && python manage.py retry_deferred -c 1
0 0 * * * cd /code && python manage.py purge_mail_log 7 -c 1 0 0 * * * cd /code && python manage.py purge_mail_log 7 -c 1
# Rebuild search index
0 * * * * cd /code && python manage.py update_index -v 0