Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Route the remaining day lookups through local_day

Roland Geidere4235f292263
diff --git a/wger/manager/models/routine.py b/wger/manager/models/routine.py
index 16f4f426a..d92771a3a 100644
--- a/wger/manager/models/routine.py
+++ b/wger/manager/models/routine.py
@@ -235,11 +235,7 @@ class Routine(models.Model):
workout_session_map = defaultdict(set)
for day in days:
for session in day.workoutsession_set.all():
- workout_session_map[day.id].add(
- timezone.localtime(session.datetime_start).date()
- if session.datetime_start
- else None
- )
+ workout_session_map[day.id].add(session.local_day)
# Main sequence generation logic
labels = self.label_dict
@@ -457,7 +453,7 @@ class Routine(models.Model):
# Iterate over each workout session associated with the routine
for session in self.sessions.all():
- session_date = timezone.localtime(session.datetime_start).date()
+ session_date = session.local_day
week_number = session_date.isocalendar().week
# TODO: filter for lb