Compare commits

...

3 Commits

Author SHA1 Message Date
Gregory Trullemans 852394f2b3 Modification de l'email envoyé pour un chrono 2023-05-20 18:21:27 +02:00
Gregory Trullemans 3e48ac0e78 Modification de l'email envoyé pour l'apprentissage d'une figure 2023-05-20 18:12:54 +02:00
Gregory Trullemans e84ae786fa Update email of notification 2023-05-19 10:56:23 +02:00
1 changed files with 9 additions and 4 deletions

View File

@ -568,6 +568,9 @@ def chrono_create_or_update(request, chrono_id=None, gymnast_id=None):
# notification
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)
functionality = ContentType.objects.get(model="chrono")
for notification in gymnast.notifications.filter(
@ -582,7 +585,7 @@ def chrono_create_or_update(request, chrono_id=None, gymnast_id=None):
receiver,
fail_silently=False,
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>""",
)
@ -654,6 +657,8 @@ def learnedskill_create_or_update(request, gymnast_id=None):
# notification
receiver = []
skill = form.cleaned_data["skill"]
learning_step = form.cleaned_data["learning_step"]
gymnast = Gymnast.objects.get(pk=form.cleaned_data["gymnast"].id)
functionality = ContentType.objects.get(model="learnedskill")
for notification in gymnast.notifications.filter(
@ -668,7 +673,7 @@ def learnedskill_create_or_update(request, gymnast_id=None):
receiver,
fail_silently=False,
html_message=f"""<p>Bonjour,</p>
<p>Un nouveau skill () a été appris par {gymnast}.</p><br />
<p>{gymnast} a appris {skill} ({learning_step}).</p><br />
<p>Excellente journée</p><p>Jarvis</p>""",
)
@ -959,7 +964,7 @@ def mindstate_create_or_update(
receiver,
fail_silently=False,
html_message=f"""<p>Bonjour,</p>
<p>Un nouvel état d'esprit enregistré pour {gymnast}.</p><br />
<p>{gymnast} a ajouté état son esprit enregistré ({date}) : {score}/10.</p><br />
<p>Excellente journée</p><p>Jarvis</p>""",
)
@ -1368,7 +1373,7 @@ def intensity_create_or_update(request, intensity_id=None, gymnast_id=None):
receiver,
fail_silently=False,
html_message=f"""<p>Bonjour,</p>
<p>{gymnast} a encodé une nouvelle intensité ({date}) : {number_of_passes} en {time}min ({difficulty} | {quantity_of_skill}).</p><br />
<p>{gymnast} a encodé une nouvelle intensité (pour le {date.strftime('%d %B %Y')}) : {number_of_passes} passages en {time} min (diff : {difficulty} | # skills : {quantity_of_skill}).</p><br />
<p>Excellente journée</p><p>Jarvis</p>""",
)