From 947015f2a4c7747dd9719e5aaded4e9878f17952 Mon Sep 17 00:00:00 2001 From: Peter Stockings Date: Sun, 4 Dec 2022 17:22:24 +1100 Subject: [PATCH] Fix bug where upon editing topset it would change exercise to Squat (1st in list) --- app.py | 2 +- templates/partials/topset.html | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index e3d1b75..fe2d986 100644 --- a/app.py +++ b/app.py @@ -173,7 +173,7 @@ def get_topset(person_id, workout_id, topset_id): def get_topset_edit_form(person_id, workout_id, topset_id): exercises = db.get_exercises() topset = db.get_topset(person_id, workout_id, topset_id) - return render_template('partials/topset.html', person_id=person_id, workout_id=workout_id, topset_id=topset_id, exercises=exercises, repetitions=topset['Repetitions'], weight=topset['Weight'], is_edit=True) + return render_template('partials/topset.html', person_id=person_id, workout_id=workout_id, topset_id=topset_id, exercises=exercises, exercise_name=topset['ExerciseName'], repetitions=topset['Repetitions'], weight=topset['Weight'], is_edit=True) @ app.route("/person//workout//topset", methods=['POST']) diff --git a/templates/partials/topset.html b/templates/partials/topset.html index bdc80b6..90aefd4 100644 --- a/templates/partials/topset.html +++ b/templates/partials/topset.html @@ -7,9 +7,9 @@ class="block appearance-none w-full bg-gray-200 border border-gray-200 text-gray-700 py-3 px-4 pr-8 rounded leading-tight focus:outline-none focus:bg-white focus:border-gray-500" name="exercise_id"> {% for exercise in exercises|default([], true) %} - + {% endfor %} {% endif %}