More CamelCase refactoring, exercise functionality refactored

This commit is contained in:
Peter Stockings
2023-12-09 16:23:04 +11:00
parent d967920e03
commit 8bbbfecbf9
2 changed files with 6 additions and 6 deletions

8
app.py
View File

@@ -211,7 +211,7 @@ def create_topset(person_id, workout_id):
workout_id, exercise_id, repetitions, weight)
exercise = db.get_exercise(exercise_id)
return render_template('partials/topset.html', person_id=person_id, workout_id=workout_id, topset_id=new_topset_id, exercise_id=exercise_id, exercise_name=exercise['Name'], repetitions=repetitions, weight=weight), 200, {"HX-Trigger": "topsetAdded"}
return render_template('partials/topset.html', person_id=person_id, workout_id=workout_id, topset_id=new_topset_id, exercise_id=exercise_id, exercise_name=exercise['name'], repetitions=repetitions, weight=weight), 200, {"HX-Trigger": "topsetAdded"}
@ app.route("/person/<int:person_id>/workout/<int:workout_id>/topset/<int:topset_id>", methods=['PUT'])
@@ -224,7 +224,7 @@ def update_topset(person_id, workout_id, topset_id):
db.update_topset(exercise_id, repetitions, weight, topset_id)
exercise = db.get_exercise(exercise_id)
return render_template('partials/topset.html', person_id=person_id, workout_id=workout_id, topset_id=topset_id, exercise_name=exercise['Name'], repetitions=repetitions, weight=weight)
return render_template('partials/topset.html', person_id=person_id, workout_id=workout_id, topset_id=topset_id, exercise_name=exercise['name'], repetitions=repetitions, weight=weight)
@ app.route("/person/<int:person_id>/workout/<int:workout_id>/topset/<int:topset_id>/delete", methods=['DELETE'])
@@ -276,13 +276,13 @@ def create_exercise():
@ app.route("/exercise/<int:exercise_id>", methods=['GET'])
def get_exercise(exercise_id):
exercise = db.get_exercise(exercise_id)
return render_template('partials/exercise.html', exercise_id=exercise_id, name=exercise['Name'])
return render_template('partials/exercise.html', exercise_id=exercise_id, name=exercise.name)
@ app.route("/exercise/<int:exercise_id>/edit_form", methods=['GET'])
def get_exercise_edit_form(exercise_id):
exercise = db.get_exercise(exercise_id)
return render_template('partials/exercise.html', exercise_id=exercise_id, name=exercise['Name'], is_edit=True)
return render_template('partials/exercise.html', exercise_id=exercise_id, name=exercise.name, is_edit=True)
@ app.route("/exercise/<int:exercise_id>/update", methods=['PUT'])