Fix error where a blank topset was rendered for a empty workout

This commit is contained in:
Peter Stockings
2022-12-03 17:55:51 +11:00
parent d9d2dc01a5
commit afeba8a244
2 changed files with 2 additions and 2 deletions

View File

@@ -15,7 +15,7 @@ def get_workouts(topsets):
workouts.append({
'WorkoutId': workout_id,
'StartDate': topsets_in_workout[0]['StartDate'],
'TopSets': [{"TopSetId": t['TopSetId'], "ExerciseId": t['ExerciseId'], "ExerciseName": t['ExerciseName'], "Weight": t['Weight'], "Repetitions": t['Repetitions']} for t in topsets_in_workout]
'TopSets': [{"TopSetId": t['TopSetId'], "ExerciseId": t['ExerciseId'], "ExerciseName": t['ExerciseName'], "Weight": t['Weight'], "Repetitions": t['Repetitions']} for t in topsets_in_workout if t['TopSetId'] is not None]
})
return workouts