From e2104d05fe79f1e2e1c719b49e0e4068c66ced60 Mon Sep 17 00:00:00 2001 From: Peter Stockings Date: Mon, 18 Sep 2023 17:44:53 +1000 Subject: [PATCH] Fix issue where when selecting a new exercise that doesnt have a previously recorded set resets on selection --- app.py | 2 +- templates/partials/new_set_form.html | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 6bb6af4..31469dc 100644 --- a/app.py +++ b/app.py @@ -418,7 +418,7 @@ def get_most_recent_topset_for_exercise(person_id, workout_id): topset = db.get_most_recent_topset_for_exercise(person_id, exercise_id) if not topset: - return render_template('partials/new_set_form.html', person_id=person_id, workout_id=workout_id, exercises=exercises, has_value=False) + return render_template('partials/new_set_form.html', person_id=person_id, workout_id=workout_id, exercises=exercises, exercise_id=exercise_id, has_value=False) (repetitions, weight) = topset return render_template('partials/new_set_form.html', person_id=person_id, workout_id=workout_id, exercises=exercises, has_value=True, exercise_id=exercise_id, repetitions=repetitions, weight=weight) diff --git a/templates/partials/new_set_form.html b/templates/partials/new_set_form.html index f91471d..00d1209 100644 --- a/templates/partials/new_set_form.html +++ b/templates/partials/new_set_form.html @@ -18,7 +18,8 @@