Fix bug where updating exercise name would persist due to missing commit
This commit is contained in:
@@ -13,9 +13,7 @@ class Exercises:
|
|||||||
return exercise
|
return exercise
|
||||||
|
|
||||||
def update_exercise_name(self, exercise_id, updated_name):
|
def update_exercise_name(self, exercise_id, updated_name):
|
||||||
sql = "UPDATE exercise SET name = %s WHERE exercise_id = %s;"
|
self.execute("UPDATE exercise SET name = %s WHERE exercise_id = %s;", [updated_name, exercise_id], commit=True)
|
||||||
params = [updated_name, exercise_id]
|
|
||||||
self.execute(sql, params)
|
|
||||||
updated_exercise = self.get_exercise(exercise_id)
|
updated_exercise = self.get_exercise(exercise_id)
|
||||||
return updated_exercise
|
return updated_exercise
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user