Add database connection to global context so repeat queries dont recreate connections(Need to check if this actually improves speed) also added in logic so if add workout is triggered when there is already a workout on that day without any topsets it will instead load that
This commit is contained in:
5
app.py
5
app.py
@@ -384,6 +384,11 @@ def get_workout_note(person_id, workout_id):
|
||||
return render_template('partials/workout_note.html', person_id=person_id, workout_id=workout_id, note=workout['Note'])
|
||||
|
||||
|
||||
@app.teardown_appcontext
|
||||
def closeConnection(exception):
|
||||
db.close_connection()
|
||||
|
||||
|
||||
@app.template_filter('list_to_string')
|
||||
def list_to_string(list):
|
||||
return [str(i) for i in list]
|
||||
|
||||
Reference in New Issue
Block a user