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:
15
utils.py
15
utils.py
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user