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

URLs in mails were missing domains

Signed-off-by: Yohann D'ANELLO <yohann.danello@animath.fr>
This commit is contained in:
Yohann D'ANELLO 2020-12-21 17:42:38 +01:00
parent 2319bdf91e
commit e05a1518d9
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
3 changed files with 7 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
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 :
<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>

View File

@ -3,7 +3,7 @@ Bonjour {{ user.registration }},
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.
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,

View File

@ -1,6 +1,8 @@
from io import BytesIO
from zipfile import ZipFile
from django.contrib.sites.models import Site
from corres2math.lists import get_sympa_client
from corres2math.matrix import Matrix
from corres2math.views import AdminMixin
@ -208,7 +210,7 @@ class TeamDetailView(LoginRequiredMixin, FormMixin, ProcessFormView, DetailView)
self.object.participation.save()
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_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)