Skip to content

Commit

Permalink
Fixed DB #2
Browse files Browse the repository at this point in the history
  • Loading branch information
egormanga committed Nov 6, 2021
1 parent 8fd7632 commit 9c37951
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions db.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ class Book(db.Model):


db.create_all()
default_user = User(id=0)
if (not User.query(id=0).first()): db.session.add(default_user)
if (not User.query.filter_by(id=0).first()):
default_user = User(id=0)
db.session.add(default_user)
db.session.commit()

# by InfantemTeam, 2021
Expand Down

0 comments on commit 9c37951

Please sign in to comment.