From 4144f3a6156aa6c0a8fa00ff9d4498e38e32ecf9 Mon Sep 17 00:00:00 2001 From: Peter Stockings Date: Mon, 20 Mar 2023 22:06:18 +1100 Subject: [PATCH] Just for htmx requests allow to unselect all exercises on list view --- app.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 31ad0d5..feb95ac 100644 --- a/app.py +++ b/app.py @@ -62,7 +62,9 @@ def get_person(person_id): 'max_date'), '%Y-%m-%d') or max_date selected_exercise_ids = [int(i) - for i in request.args.getlist('exercise_id')] or [e['ExerciseId'] for e in person['Exercises']] + for i in request.args.getlist('exercise_id')] + if not selected_exercise_ids and not htmx: + 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 workout['StartDate'] <= max_date and workout['StartDate'] >= min_date]