Skip to content

Commit 0d195b7

Browse files
updated to work with latest sqlalchemy
1 parent 2c78bed commit 0d195b7

File tree

2 files changed

+551
-540
lines changed

2 files changed

+551
-540
lines changed

flask_session/sessions.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,8 +647,9 @@ def __repr__(self):
647647

648648
from sqlalchemy import inspect
649649

650-
if not inspect(db.engine).has_table("Session"):
651-
self.db.create_all()
650+
with app.app_context():
651+
if not inspect(db.engine).has_table("Session"):
652+
self.db.create_all()
652653

653654
self.sql_session_model = Session
654655

0 commit comments

Comments
 (0)