diff --git a/rowers/plannedsessions.py b/rowers/plannedsessions.py index 6428378e..73f3a364 100644 --- a/rowers/plannedsessions.py +++ b/rowers/plannedsessions.py @@ -32,27 +32,27 @@ import courses from rowers.tasks import handle_check_race_course -def get_todays_micro(plan): +def get_todays_micro(plan,thedate=date.today()): thismicro = None thismacro = TrainingMacroCycle.objects.filter( plan=plan, - startdate__lte = date.today(), - enddate__gte = date.today() + startdate__lte = thedate, + enddate__gte = thedate ) if thismacro: thismeso = TrainingMesoCycle.objects.filter( plan=thismacro[0], - startdate__lte = date.today(), - enddate__gte = date.today() + startdate__lte = thedate, + enddate__gte = thedate ) if thismeso: thismicro = TrainingMicroCycle.objects.filter( plan=thismeso[0], - startdate__lte = date.today(), - enddate__gte = date.today() + startdate__lte = thedate, + enddate__gte = thedate ) if thismicro: diff --git a/rowers/templates/menu_plan.html b/rowers/templates/menu_plan.html index 018fd7d7..a9065fd0 100644 --- a/rowers/templates/menu_plan.html +++ b/rowers/templates/menu_plan.html @@ -15,7 +15,7 @@ {% for plan in rower|trainingplans %}