diff options
| author | stilbruch <stilbruch@protonmail.com> | 2022-04-23 13:24:57 -0500 |
|---|---|---|
| committer | stilbruch <stilbruch@protonmail.com> | 2022-04-23 13:24:57 -0500 |
| commit | 5d08424481a8a6ae1b69c96a6ee43394d9aa8963 (patch) | |
| tree | 3ae6a11a0a5133e32ad76c0c45ee27711358d216 /app/routes.py | |
| parent | 7ab43e8d4f35f1da6a8778c603eba47ce315bc88 (diff) | |
| download | Strengthy-5d08424481a8a6ae1b69c96a6ee43394d9aa8963.tar.xz Strengthy-5d08424481a8a6ae1b69c96a6ee43394d9aa8963.zip | |
Start workout record page
Diffstat (limited to 'app/routes.py')
| -rw-r--r-- | app/routes.py | 11 |
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 |
