Skip to content

Commit

Permalink
Replace deprecated decorator before_first_request
Browse files Browse the repository at this point in the history
  • Loading branch information
PanderMusubi committed Sep 19, 2023
1 parent 02093bf commit a0dcfc2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Changelog
Release date: -

- Upgrade to Bootstrap 5.3.1 and Bootswatch 5.3.1
- Replaced deprecated Flask decorator before_first_request


2.3.0
Expand Down
3 changes: 1 addition & 2 deletions examples/bootstrap4/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@ class Message(db.Model):
create_time = db.Column(db.Integer, nullable=False, unique=True)


@app.before_first_request
def before_first_request_func():
with app.app_context():
db.drop_all()
db.create_all()
for i in range(20):
Expand Down
3 changes: 1 addition & 2 deletions examples/bootstrap5/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ class Message(db.Model):
create_time = db.Column(db.Integer, nullable=False, unique=True)


@app.before_first_request
def before_first_request_func():
with app.app_context():
db.drop_all()
db.create_all()
for i in range(20):
Expand Down

0 comments on commit a0dcfc2

Please sign in to comment.