Fix bug where updating exercise name would persist due to missing commit

This commit is contained in:
Peter Stockings
2024-11-04 16:59:14 +11:00
parent 64c3335c29
commit 1a970d1d7b

View File

@@ -13,9 +13,7 @@ class Exercises:
return exercise
def update_exercise_name(self, exercise_id, updated_name):
sql = "UPDATE exercise SET name = %s WHERE exercise_id = %s;"
params = [updated_name, exercise_id]
self.execute(sql, params)
self.execute("UPDATE exercise SET name = %s WHERE exercise_id = %s;", [updated_name, exercise_id], commit=True)
updated_exercise = self.get_exercise(exercise_id)
return updated_exercise