From 786b06887415a4e709af7159ff41b3a2a09e326d Mon Sep 17 00:00:00 2001 From: Peter Stockings Date: Mon, 8 May 2023 19:55:09 +1000 Subject: [PATCH] Delete workout associated heart rate readings --- app.py | 1 + templates/new_workout.html | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index da792d7..fa86f4b 100644 --- a/app.py +++ b/app.py @@ -199,6 +199,7 @@ def view_workout(user_id, workout_id): def delete_workout(user_id, workout_id): # Delete the workout and its associated cadence readings CadenceReading.query.filter_by(workout_id=workout_id).delete() + HeartRateReading.query.filter_by(workout_id=workout_id).delete() db.session.delete(workout) db.session.commit() workouts_data = get_workouts_for_user(user_id) diff --git a/templates/new_workout.html b/templates/new_workout.html index b9dc529..94e4ef7 100644 --- a/templates/new_workout.html +++ b/templates/new_workout.html @@ -455,7 +455,6 @@ // Heart Rate monitor code heartRateButton.addEventListener('click', async () => { - console.log('heartRateButton clicked, isHearRateMonitorActive: ', isHearRateMonitorActive); if (isHearRateMonitorActive) { console.log('Stopping heart rate monitor...'); await disconnectHeartRateMonitor();