summaryrefslogtreecommitdiff
path: root/app/routes.py
diff options
context:
space:
mode:
authorstilbruch <stilbruch@protonmail.com>2022-04-23 13:24:57 -0500
committerstilbruch <stilbruch@protonmail.com>2022-04-23 13:24:57 -0500
commit5d08424481a8a6ae1b69c96a6ee43394d9aa8963 (patch)
tree3ae6a11a0a5133e32ad76c0c45ee27711358d216 /app/routes.py
parent7ab43e8d4f35f1da6a8778c603eba47ce315bc88 (diff)
downloadStrengthy-5d08424481a8a6ae1b69c96a6ee43394d9aa8963.tar.xz
Strengthy-5d08424481a8a6ae1b69c96a6ee43394d9aa8963.zip
Start workout record page
Diffstat (limited to 'app/routes.py')
-rw-r--r--app/routes.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/routes.py b/app/routes.py
index 8f5d8c1..76ea96a 100644
--- a/app/routes.py
+++ b/app/routes.py
@@ -115,7 +115,16 @@ def editWorkout():
@app.route("/workout/record", methods=['GET'])
@login_required
def recordWorkout():
- return render_template('workout/record.html')
+ # Id is required
+ if 'id' not in request.args:
+ return redirect(url_for('home'))
+
+ # Matching workout required
+ workout = Workout.query.filter_by(id=int(request.args['id']), user_id=current_user.id).first()
+ if not workout:
+ return redirect(url_for('home'));
+
+ return render_template('workout/record.html', workout=workout)
@app.route("/workout/select", methods=['GET'])
@login_required