From 1a1417920afc120a0fb42b8b0a8822786b9bc11b Mon Sep 17 00:00:00 2001 From: Peter Stockings Date: Fri, 10 Mar 2023 22:54:44 +1100 Subject: [PATCH] After successfully adding workout and confirming prompt user is redirected back to overview page --- app.py | 2 +- templates/new_workout.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index ea93325..1055a07 100644 --- a/app.py +++ b/app.py @@ -204,7 +204,7 @@ def get_workouts_for_user(user_id): workouts_data.append({ 'id': workout.id, 'user_id': user_id, - 'start_time': format_date_with_ordinal(start_time, '%H:%M %B %dth %Y'), + 'start_time': format_date_with_ordinal(start_time, '%#H:%M %B %dth %Y'), 'duration': format_duration(duration), 'average_rpm': int(average_rpm) }) diff --git a/templates/new_workout.html b/templates/new_workout.html index 1d3c07f..0de53ce 100644 --- a/templates/new_workout.html +++ b/templates/new_workout.html @@ -118,7 +118,7 @@ }, body: JSON.stringify({ workout: workout }), }).then(res => res.json()) - .then(res => swal("Submitted", JSON.stringify(res), "success")) + .then(res => swal("Submitted", JSON.stringify(res), "success").then(isConfirm => window.location.href = '/')) .catch(err => swal("Failed to submit workout", err.message, "error")); workout = [];