Fix error thrown when viewing profile of a person with a single workout with a single topset

This commit is contained in:
Peter Stockings
2022-12-04 19:35:53 +11:00
parent e0c17fb039
commit fe8852c15d

View File

@@ -111,6 +111,7 @@ def get_stats_from_topsets(topsets):
date.today() - last_workout_date).days})
training_duration = last_workout_date - first_workout_date
if training_duration > timedelta(days=0):
average_workouts_per_week = round(
workout_count / (training_duration.days / 7), 2)
stats.append({"Text": "Average Workouts Per Week",