Permalink
Browse files

Updated examples

  • Loading branch information...
1 parent 115d31d commit b51ecd7f212588b3d7363db90a4ab8318ec2fa80 @mitsuhiko mitsuhiko committed May 27, 2011
Showing with 4 additions and 6 deletions.
  1. +2 −3 examples/flaskr/flaskr.py
  2. +2 −3 examples/minitwit/minitwit.py
@@ -47,11 +47,10 @@ def before_request():
g.db = connect_db()
-@app.after_request
-def after_request(response):
+@app.teardown_request
+def teardown_request(exception):
"""Closes the database again at the end of the request."""
g.db.close()
- return response
@app.route('/')
@@ -82,11 +82,10 @@ def before_request():
[session['user_id']], one=True)
-@app.after_request
-def after_request(response):
+@app.teardown_request
+def teardown_request(exception):
"""Closes the database again at the end of the request."""
g.db.close()
- return response
@app.route('/')

0 comments on commit b51ecd7

Please sign in to comment.