Update email objectif

This commit is contained in:
Gregory Trullemans 2023-06-13 14:35:29 +02:00
parent e8c8c2f52b
commit 2b284a4705
3 changed files with 29 additions and 4 deletions

View File

@ -79,6 +79,28 @@ Pour charger les données, tapez ensuite :
```bash
python manage.py loaddata save.json
```
## Commandes
Pour refaire la learning line des skills :
```python
heroku run python manage.py rebuild_closure_table_tree_for_skill
```
Pour refaire la learning line des séries :
```python
heroku run python manage.py rebuild_closure_table_tree_for_routine
```
Pour remettre tous les rank des skills à 0 :
```python
heroku run python manage.py remove_rank_from_skill
```
Pour retirer les espaces dans le code numérique des skills :
```python
heroku run python manage.py remove_space_from_skill_notation
```
## Applications
### Right

View File

@ -1263,6 +1263,9 @@ def plan_create_or_update(request, plan_id=None, gymnast_id=None, skill_id=None)
# notification
receiver = []
gymnast = Gymnast.objects.get(pk=form.cleaned_data["gymnast"].id)
date = form.cleaned_data["date"]
educative = form.cleaned_data["educative"]
learning_step = form.cleaned_data["learning_step"]
functionality = ContentType.objects.get(model="plan")
for notification in gymnast.notifications.filter(
functionality=functionality
@ -1270,13 +1273,13 @@ def plan_create_or_update(request, plan_id=None, gymnast_id=None, skill_id=None)
receiver.append(notification.user.email)
send_mail(
f"{gymnast} : Nouvelle série comptabilisée",
f"Nouvelle série comptabilisée pour {gymnast}",
f"{gymnast} : Nouvel objectif fixé",
f"Nouvel objectif fixé pour {gymnast}",
settings.EMAIL_HOST_USER,
receiver,
fail_silently=False,
html_message=f"""<p>Bonjour,</p>
<p>Nouvelle série comptabilisée pour {gymnast}.</p><br />
<p>Nouvel objectif fixé pour {gymnast} : {educative} ({learning_step}) pour le {date} au plus tard.</p><br />
<p>Excellente journée</p><p>Jarvis</p>""",
)

View File

@ -87,7 +87,7 @@
<td class="text-left">
<a href="{% url 'note_details' note.id %}">{{ note.title }}</a>
</td>
<td class="text-left">{{ note.coach }}</td>
<td class="text-center">{{ note.coach }}</td>
</tr>
{% endfor %}
</tbody>