Fix bug where left join on person and workouts would return a row even when there wasnt an exercise and therefore crashing on person list view

This commit is contained in:
Peter Stockings
2024-05-18 18:27:09 +10:00
parent 910437010d
commit 73c1e115bb

View File

@@ -71,14 +71,15 @@ def get_topsets_for_person(person_topsets):
person_id = sorted_topsets[0]['PersonId']
exercise_name = sorted_topsets[0]['ExerciseName']
exercise_progress = get_exercise_graph_model(exercise_name, estimated_1rm, repetitions, weight, start_dates, messages, epoch, person_id, exercise_id)
if exercise_name and estimated_1rm and repetitions and weight and start_dates and messages:
exercise_progress = get_exercise_graph_model(exercise_name, estimated_1rm, repetitions, weight, start_dates, messages, epoch, person_id, exercise_id)
exercises_topsets.append({
'ExerciseId': exercise_id,
'ExerciseName': exercise_name,
'Topsets': sorted_topsets,
'ExerciseProgressGraph': exercise_progress
})
exercises_topsets.append({
'ExerciseId': exercise_id,
'ExerciseName': exercise_name,
'Topsets': sorted_topsets,
'ExerciseProgressGraph': exercise_progress
})
return exercises_topsets