Improve season/week view
This commit is contained in:
parent
e0aecba4c7
commit
935ffdae7c
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue