Only allow clearing of selected exercises if user is deselecting from exercise picker

This commit is contained in:
Peter Stockings
2023-03-20 22:16:44 +11:00
parent 4144f3a615
commit 2499185b2d

2
app.py
View File

@@ -63,7 +63,7 @@ def get_person(person_id):
selected_exercise_ids = [int(i)
for i in request.args.getlist('exercise_id')]
if not selected_exercise_ids and not htmx:
if not selected_exercise_ids and htmx.trigger_name != 'exercise_id':
selected_exercise_ids = [e['ExerciseId'] for e in person['Exercises']]
person['Workouts'] = [filter_workout_topsets(workout, selected_exercise_ids) for workout in person['Workouts'] if