From 1e6bac55603cec7a2e3df41e5c28835194fb0316 Mon Sep 17 00:00:00 2001 From: Gregory Trullemans Date: Fri, 7 Oct 2022 11:27:38 +0200 Subject: [PATCH] Improve season/week view --- ultron/followup/views.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ultron/followup/views.py b/ultron/followup/views.py index fb45e93f6e..8b0d9f431a 100644 --- a/ultron/followup/views.py +++ b/ultron/followup/views.py @@ -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)