Fix error where a blank topset was rendered for a empty workout
This commit is contained in:
2
utils.py
2
utils.py
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user