summaryrefslogtreecommitdiff
path: root/app/routes
diff options
context:
space:
mode:
Diffstat (limited to 'app/routes')
-rw-r--r--app/routes/workout.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/app/routes/workout.py b/app/routes/workout.py
index de2fe51..5eb18d9 100644
--- a/app/routes/workout.py
+++ b/app/routes/workout.py
@@ -32,16 +32,12 @@ def workout_create():
return render_template("workout/create.html", form=form)
-@app.route("/workout/edit", methods=["GET", "POST"])
+@app.route("/workout/edit/<workout_id>", methods=["GET", "POST"])
@login_required
-def workout_edit():
- # Id is required
- if "id" not in request.args:
- return redirect(url_for("home"))
-
+def workout_edit(workout_id=None):
# Validate Id
workout = Workout.query.filter_by(
- id=int(request.args["id"]), user_id=current_user.id
+ id=int(workout_id), user_id=current_user.id
).first()
if not workout:
return redirect(url_for("home"))