df
This commit is contained in:
parent
84e52bfe0a
commit
6dfd3615e8
1 changed files with 2 additions and 1 deletions
|
@ -159,7 +159,8 @@ def before_request():
|
|||
@app.teardown_appcontext
|
||||
def teardown_request(error):
|
||||
if hasattr(g, 'db') and g.db:
|
||||
g.db.commit()
|
||||
try: g.db.commit()
|
||||
except: g.db.rolleback()
|
||||
g.db.close()
|
||||
|
||||
@app.after_request
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue