Modification de l'email envoyé pour un chrono

This commit is contained in:
Gregory Trullemans 2023-05-20 18:21:27 +02:00
parent 3e48ac0e78
commit 852394f2b3
1 changed files with 4 additions and 1 deletions

View File

@ -568,6 +568,9 @@ def chrono_create_or_update(request, chrono_id=None, gymnast_id=None):
# notification # notification
receiver = [] receiver = []
score = form.cleaned_data["score"]
score_type = form.cleaned_data["score_type"]
chrono_type = form.cleaned_data["chrono_type"]
gymnast = Gymnast.objects.get(pk=form.cleaned_data["gymnast"].id) gymnast = Gymnast.objects.get(pk=form.cleaned_data["gymnast"].id)
functionality = ContentType.objects.get(model="chrono") functionality = ContentType.objects.get(model="chrono")
for notification in gymnast.notifications.filter( for notification in gymnast.notifications.filter(
@ -582,7 +585,7 @@ def chrono_create_or_update(request, chrono_id=None, gymnast_id=None):
receiver, receiver,
fail_silently=False, fail_silently=False,
html_message=f"""<p>Bonjour,</p> html_message=f"""<p>Bonjour,</p>
<p>Un nouveau chrono enregistré pour {gymnast}.</p><br /> <p>Nouveau chrono pour {gymnast} : {chrono_type} - {score} ({score_type}).</p><br />
<p>Excellente journée</p><p>Jarvis</p>""", <p>Excellente journée</p><p>Jarvis</p>""",
) )