Improve season/week view

This commit is contained in:
Gregory Trullemans 2022-10-07 11:27:38 +02:00
parent f83af287a7
commit 533bdec106
1 changed files with 2 additions and 3 deletions

View File

@ -38,6 +38,7 @@ from .forms import (
)
from ultron.tools.date_week_transition import (
is_valid_season,
from_date_to_week_number,
from_week_number_to_date,
)
@ -91,9 +92,7 @@ def average_jump_chrono_details_for_week_of_season(request, gymnast_id, routine_
if week_number < 1:
week_number = 1
pattern = "^[0-9]{4}-[0-9]{4}$"
if season is None:
if season is None or not is_valid_season(season):
season = str(today.year) + "-" + str(today.year + 1)
date_begin, date_end = from_week_number_to_date(season, week_number)