Skip to content

Commit 731679d

Browse files
authoredJul 11, 2023
Merge pull request #96 from felpud0/master
Before_first_request deprecation fix
2 parents 7924afc + 6a04875 commit 731679d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed
 

‎website/app.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,10 @@ def create_app(config=None):
2727

2828

2929
def setup_app(app):
30-
# Create tables if they do not exist already
31-
@app.before_first_request
32-
def create_tables():
33-
db.create_all()
3430

3531
db.init_app(app)
32+
# Create tables if they do not exist already
33+
with app.app_context():
34+
db.create_all()
3635
config_oauth(app)
3736
app.register_blueprint(bp, url_prefix='')

0 commit comments

Comments
 (0)
Failed to load comments.