Fix error thrown when viewing profile of a person with a single workout with a single topset
This commit is contained in:
1
utils.py
1
utils.py
@@ -111,6 +111,7 @@ def get_stats_from_topsets(topsets):
|
|||||||
date.today() - last_workout_date).days})
|
date.today() - last_workout_date).days})
|
||||||
|
|
||||||
training_duration = last_workout_date - first_workout_date
|
training_duration = last_workout_date - first_workout_date
|
||||||
|
if training_duration > timedelta(days=0):
|
||||||
average_workouts_per_week = round(
|
average_workouts_per_week = round(
|
||||||
workout_count / (training_duration.days / 7), 2)
|
workout_count / (training_duration.days / 7), 2)
|
||||||
stats.append({"Text": "Average Workouts Per Week",
|
stats.append({"Text": "Average Workouts Per Week",
|
||||||
|
|||||||
Reference in New Issue
Block a user