Update SeasonInformations model and fix bug on SI create_or_update view
This commit is contained in:
parent
88fa233b7a
commit
5dce3830d0
|
@ -0,0 +1,31 @@
|
|||
# Generated by Django 4.2 on 2024-02-04 11:13
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("followup", "0062_intensity_difficulty_asked_and_more"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="seasoninformation",
|
||||
name="number_of_hours_per_week",
|
||||
field=models.DecimalField(
|
||||
decimal_places=1, max_digits=3, verbose_name="# Hours/w"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="seasoninformation",
|
||||
name="number_of_s_and_c_hours_per_week",
|
||||
field=models.DecimalField(
|
||||
blank=True,
|
||||
decimal_places=1,
|
||||
max_digits=3,
|
||||
null=True,
|
||||
verbose_name="# S&C hours/w",
|
||||
),
|
||||
),
|
||||
]
|
|
@ -758,18 +758,20 @@ class SeasonInformation(models.Model):
|
|||
number_of_training_sessions_per_week = models.PositiveSmallIntegerField(
|
||||
verbose_name="# Training/w"
|
||||
)
|
||||
number_of_hours_per_week = models.PositiveSmallIntegerField(
|
||||
verbose_name="# Hours/w"
|
||||
number_of_hours_per_week = models.DecimalField(
|
||||
verbose_name="# Hours/w", max_digits=3, decimal_places=1
|
||||
)
|
||||
number_of_s_and_c_sessions_per_week = models.PositiveSmallIntegerField(
|
||||
verbose_name="# S&C training/w",
|
||||
blank=True,
|
||||
null=True,
|
||||
)
|
||||
number_of_s_and_c_hours_per_week = models.PositiveSmallIntegerField(
|
||||
number_of_s_and_c_hours_per_week = models.DecimalField(
|
||||
verbose_name="# S&C hours/w",
|
||||
blank=True,
|
||||
null=True,
|
||||
max_digits=3,
|
||||
decimal_places=1,
|
||||
)
|
||||
category = models.PositiveSmallIntegerField(
|
||||
choices=CATEGORY_CHOICES_ARRAY,
|
||||
|
|
|
@ -1577,7 +1577,7 @@ def season_information_create_or_update(
|
|||
|
||||
title = f"{season_information.gymnast} : Nouvelle information de saison"
|
||||
body = f"""<p>Bonjour,</p>
|
||||
<p>Une nouvelle information de saison enregistrée pour {gymnast}.</p>"""
|
||||
<p>Une nouvelle information de saison enregistrée pour {season_information.gymnast}.</p>"""
|
||||
|
||||
Email.objects.create(receivers=receivers, title=title, body=body)
|
||||
|
||||
|
|
Loading…
Reference in New Issue