Skip to content

Commit 3113628

Browse files
committed
adding teardown_appcontext
1 parent 98840ee commit 3113628

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/cs50/sql.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ def execute(self, sql, *args, **kwargs):
290290
# Use this connection
291291
connection = getattr(_data, self._name())
292292

293-
"""TODO
293+
# Disconnect if/when a Flask app is torn down
294294
try:
295295
import flask
296296
assert flask.current_app
@@ -300,7 +300,6 @@ def teardown_appcontext(exception):
300300
flask.current_app.teardown_appcontext(teardown_appcontext)
301301
except (ModuleNotFoundError, AssertionError):
302302
pass
303-
"""
304303

305304
# Catch SQLAlchemy warnings
306305
with warnings.catch_warnings():

0 commit comments

Comments
 (0)